Skip to content

Rustdoc reports broken-intra-doc-links for Github markdown [!IMPORTANT]-type blockquotes #141866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Qix- opened this issue Jun 1, 2025 · 3 comments
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-discussion Category: Discussion or questions that doesn't represent real issues. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Qix-
Copy link

Qix- commented Jun 1, 2025

I tried this code:

#![doc = include_str!("../README.md")]
> [!IMPORTANT]
> This is an important message

I expected to see this happen: Rustdoc at least generating documentation (perhaps not with specialized support for the [!FOO] syntax, but at least not error)

Instead, this happened: With env RUSTFLAGS="-D warnings", rustdoc errored with unresolved link to '!NOTICE'

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (6f6971078 2025-05-28)
binary: rustc
commit-hash: 6f69710780d579b180ab38da4c1384d630f7bd31
commit-date: 2025-05-28
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

rustdoc --version --verbose:

rustdoc 1.89.0-nightly (6f6971078 2025-05-28)
binary: rustdoc
commit-hash: 6f69710780d579b180ab38da4c1384d630f7bd31
commit-date: 2025-05-28
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5
@Qix- Qix- added the C-bug Category: This is a bug. label Jun 1, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 1, 2025
@lolbinarycat lolbinarycat added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-discussion Category: Discussion or questions that doesn't represent real issues. A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 1, 2025
@lolbinarycat
Copy link
Contributor

We actually already suppress this lint on shortcut-style links specifically in some cases, so i guess it wouldn't be the worst to suppress them in a few other cases, i guess?

@Qix-
Copy link
Author

Qix- commented Jun 1, 2025

Yeah, especially given that there are a finite number of them: https://github.com/orgs/community/discussions/16925

If you point me in the right direction as to where to look for this, I'm happy to submit a PR :)

@lolbinarycat
Copy link
Contributor

it's in preprocess_link in passes/collect_intra_doc_links.rs.

we could probably just look for the ! at the start for shortcut links specifically (collapsed links and all the other ones are pretty unambiguous)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-discussion Category: Discussion or questions that doesn't represent real issues. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants