Skip to content

Commit 4bf9c83

Browse files
Add regression test for #151411
1 parent 88ad3d4 commit 4bf9c83

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

tests/rustdoc-ui/intra-doc/deprecated-note-from-reexported.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,19 @@ pub mod bar {
1414
//~| ERROR: unresolved link
1515
pub fn sql_function_proc() {}
1616
}
17+
18+
pub use fuzz_test_helpers::*;
19+
20+
/// A type referenced in the deprecation note.
21+
pub struct Env;
22+
23+
impl Env {
24+
pub fn try_invoke(&self) {}
25+
}
26+
27+
mod fuzz_test_helpers {
28+
#[deprecated(note = "use [Env::try_invoke] instead")]
29+
//~^ ERROR: unresolved link
30+
//~| ERROR: unresolved link
31+
pub fn fuzz_catch_panic() {}
32+
}

tests/rustdoc-ui/intra-doc/deprecated-note-from-reexported.stderr

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ note: the lint level is defined here
1616
LL | #![deny(rustdoc::broken_intra_doc_links)]
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818

19+
error: unresolved link to `Env::try_invoke`
20+
--> $DIR/deprecated-note-from-reexported.rs:28:25
21+
|
22+
LL | #[deprecated(note = "use [Env::try_invoke] instead")]
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
|
25+
= note: the link appears in this line:
26+
27+
use [Env::try_invoke] instead
28+
^^^^^^^^^^^^^^^
29+
= note: no item named `Env` in scope
30+
1931
error: unresolved link to `define_sql_function`
2032
--> $DIR/deprecated-note-from-reexported.rs:12:25
2133
|
@@ -30,5 +42,18 @@ LL | #[deprecated(note = "Use [`define_sql_function`] instead")]
3042
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
3143
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3244

33-
error: aborting due to 2 previous errors
45+
error: unresolved link to `Env::try_invoke`
46+
--> $DIR/deprecated-note-from-reexported.rs:28:25
47+
|
48+
LL | #[deprecated(note = "use [Env::try_invoke] instead")]
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50+
|
51+
= note: the link appears in this line:
52+
53+
use [Env::try_invoke] instead
54+
^^^^^^^^^^^^^^^
55+
= note: no item named `Env` in scope
56+
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
57+
58+
error: aborting due to 4 previous errors
3459

0 commit comments

Comments
 (0)