Skip to content

Commit 237ed16

Browse files
author
Lukas Markeffsky
committed
add tests for broken links in unused doc strings
1 parent bb98f3a commit 237ed16

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Test that we don't ICE with broken links that don't show up in the docs.
2+
3+
// check-pass
4+
// edition: 2021
5+
6+
/// [1]
7+
//~^ WARN unresolved link to `1`
8+
//~| WARN unresolved link to `1`
9+
pub use {std, core};
10+
11+
/// [2]
12+
pub use {};
13+
14+
/// [3]
15+
//~^ WARN unresolved link to `3`
16+
pub extern crate alloc;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
warning: unresolved link to `3`
2+
--> $DIR/broken-link-in-unused-doc-string.rs:14:6
3+
|
4+
LL | /// [3]
5+
| ^ no item named `3` in scope
6+
|
7+
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
8+
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
9+
10+
warning: unresolved link to `1`
11+
--> $DIR/broken-link-in-unused-doc-string.rs:6:6
12+
|
13+
LL | /// [1]
14+
| ^ no item named `1` in scope
15+
|
16+
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
17+
18+
warning: unresolved link to `1`
19+
--> $DIR/broken-link-in-unused-doc-string.rs:6:6
20+
|
21+
LL | /// [1]
22+
| ^ no item named `1` in scope
23+
|
24+
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
25+
26+
warning: 3 warnings emitted
27+

0 commit comments

Comments
 (0)