-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit error for ambiguities still not resolved at later stage
- Loading branch information
1 parent
4aca4e1
commit 07da6fe
Showing
3 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This test ensures that ambiguities resolved at a later stage still emit an error. | ||
|
||
#![deny(rustdoc::broken_intra_doc_links)] | ||
#![crate_name = "foo"] | ||
|
||
pub struct Thing {} | ||
|
||
#[allow(non_snake_case)] | ||
pub fn Thing() {} | ||
|
||
/// Do stuff with [`Thing`]. | ||
//~^ ERROR `Thing` is both a function and a struct | ||
pub fn repro(_: Thing) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error: `Thing` is both a function and a struct | ||
--> $DIR/filter-out-private.rs:11:21 | ||
| | ||
LL | /// Do stuff with [`Thing`]. | ||
| ^^^^^ ambiguous link | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/filter-out-private.rs:3:9 | ||
| | ||
LL | #![deny(rustdoc::broken_intra_doc_links)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
help: to link to the function, add parentheses | ||
| | ||
LL | /// Do stuff with [`Thing()`]. | ||
| ++ | ||
help: to link to the struct, prefix with `struct@` | ||
| | ||
LL | /// Do stuff with [`struct@Thing`]. | ||
| +++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|