Skip to content

Commit 1fcf0c7

Browse files
Add regression test for ICE when deprecated note is not resolved on the correct DefId
1 parent 45425ed commit 1fcf0c7

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This test ensures that the intra-doc link from reexported deprecated attribute note
2+
// are resolved where they are declared.
3+
4+
#![deny(rustdoc::broken_intra_doc_links)]
5+
6+
#[doc(inline)]
7+
pub use bar::sql_function_proc as sql_function;
8+
9+
pub fn define_sql_function() {}
10+
11+
pub mod bar {
12+
#[deprecated(note = "Use [`define_sql_function`] instead")]
13+
//~^ ERROR: unresolved link
14+
//~| ERROR: unresolved link
15+
pub fn sql_function_proc() {}
16+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error: unresolved link to `define_sql_function`
2+
--> $DIR/deprecated-note-from-reexported.rs:12:25
3+
|
4+
LL | #[deprecated(note = "Use [`define_sql_function`] instead")]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: the link appears in this line:
8+
9+
Use [`define_sql_function`] instead
10+
^^^^^^^^^^^^^^^^^^^^^
11+
= note: no item named `define_sql_function` in scope
12+
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
13+
note: the lint level is defined here
14+
--> $DIR/deprecated-note-from-reexported.rs:4:9
15+
|
16+
LL | #![deny(rustdoc::broken_intra_doc_links)]
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
error: unresolved link to `define_sql_function`
20+
--> $DIR/deprecated-note-from-reexported.rs:12:25
21+
|
22+
LL | #[deprecated(note = "Use [`define_sql_function`] instead")]
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
|
25+
= note: the link appears in this line:
26+
27+
Use [`define_sql_function`] instead
28+
^^^^^^^^^^^^^^^^^^^^^
29+
= note: no item named `define_sql_function` in scope
30+
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
31+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
32+
33+
error: aborting due to 2 previous errors
34+

0 commit comments

Comments
 (0)