Skip to content

Commit 977a7ca

Browse files
committed
Add test for disambiguator mismatch with crate
This currently calls `std` a "crate" in one part of the message and a "module" in another part. The next commits fix this so it says "crate" in both places.
1 parent ca20d64 commit 977a7ca

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,9 @@ trait T {}
7373
//~^ ERROR incompatible link kind for `f`
7474
//~| NOTE this link resolved
7575
//~| HELP add parentheses
76+
77+
/// Link to [fn@std]
78+
//~^ ERROR unresolved link to `std`
79+
//~| NOTE this link resolves to the crate `std`
80+
//~| HELP to link to the module, prefix with `mod@`
7681
pub fn f() {}

src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,16 @@ LL - /// Link to [const@f]
138138
LL + /// Link to [f()]
139139
|
140140

141-
error: aborting due to 12 previous errors
141+
error: unresolved link to `std`
142+
--> $DIR/disambiguator-mismatch.rs:77:14
143+
|
144+
LL | /// Link to [fn@std]
145+
| ^^^^^^ this link resolves to the crate `std`, which is not in the value namespace
146+
|
147+
help: to link to the module, prefix with `mod@`
148+
|
149+
LL | /// Link to [mod@std]
150+
| ~~~~
151+
152+
error: aborting due to 13 previous errors
142153

0 commit comments

Comments
 (0)