Skip to content
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

rustdoc: Note that forbidding anchors in links to primitives is a bug #84201

Merged
merged 1 commit into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,10 @@ fn anchor_failure(cx: &DocContext<'_>, diag_info: DiagnosticInfo<'_>, failure: A
if let Some(sp) = sp {
diag.span_label(sp, "contains invalid anchor");
}
if let AnchorFailure::RustdocAnchorConflict(Res::Primitive(_)) = failure {
diag.note("this restriction may be lifted in a future release");
diag.note("see https://github.com/rust-lang/rust/issues/83083 for more information");
}
});
}

Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-ui/intra-doc/anchors.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ note: the lint level is defined here
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this restriction may be lifted in a future release
= note: see https://github.com/rust-lang/rust/issues/83083 for more information

error: `Foo::f#hola` contains an anchor, but links to fields are already anchored
--> $DIR/anchors.rs:25:15
Expand All @@ -33,6 +35,9 @@ error: `u32#hello` contains an anchor, but links to builtin types are already an
|
LL | /// [u32#hello]
| ^^^^^^^^^ contains invalid anchor
|
= note: this restriction may be lifted in a future release
= note: see https://github.com/rust-lang/rust/issues/83083 for more information

error: aborting due to 5 previous errors