Skip to content

Commit 35ccf18

Browse files
Add regression test for #151411
1 parent 88ad3d4 commit 35ccf18

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

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

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

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:29: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:29: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)