render intra-doc links in the #[deprectated] note

This commit is contained in:
Folkert de Vries 2026-01-06 12:04:38 +01:00
parent 64c78f6e74
commit 3be74a7441
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
11 changed files with 179 additions and 22 deletions

View file

@ -0,0 +1,10 @@
#![deny(rustdoc::broken_intra_doc_links)]
#[deprecated = "[broken cross-reference](TypeAlias::hoge)"] //~ ERROR
pub struct A;
#[deprecated(since = "0.0.0", note = "[broken cross-reference](TypeAlias::hoge)")] //~ ERROR
pub struct B1;
#[deprecated(note = "[broken cross-reference](TypeAlias::hoge)", since = "0.0.0")] //~ ERROR
pub struct B2;

View file

@ -0,0 +1,43 @@
error: unresolved link to `TypeAlias::hoge`
--> $DIR/deprecated.rs:3:1
|
LL | #[deprecated = "[broken cross-reference](TypeAlias::hoge)"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:
[broken cross-reference](TypeAlias::hoge)
^^^^^^^^^^^^^^^
= note: no item named `TypeAlias` in scope
note: the lint level is defined here
--> $DIR/deprecated.rs:1:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unresolved link to `TypeAlias::hoge`
--> $DIR/deprecated.rs:6:1
|
LL | #[deprecated(since = "0.0.0", note = "[broken cross-reference](TypeAlias::hoge)")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:
[broken cross-reference](TypeAlias::hoge)
^^^^^^^^^^^^^^^
= note: no item named `TypeAlias` in scope
error: unresolved link to `TypeAlias::hoge`
--> $DIR/deprecated.rs:9:1
|
LL | #[deprecated(note = "[broken cross-reference](TypeAlias::hoge)", since = "0.0.0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:
[broken cross-reference](TypeAlias::hoge)
^^^^^^^^^^^^^^^
= note: no item named `TypeAlias` in scope
error: aborting due to 3 previous errors