-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #87078 - fee1-dead:rustdoc, r=jyn514
Rustdoc: suggest removing disambiguator if linking to field This fixes #85615. `@rustbot` label T-rustdoc
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 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,11 @@ | ||
#![deny(rustdoc::broken_intra_doc_links)] | ||
//~^NOTE the lint level is defined here | ||
|
||
/// [`Foo::bar`] | ||
/// [`Foo::bar()`] | ||
//~^ERROR incompatible link kind for `Foo::bar` | ||
//~|HELP to link to the field, remove the disambiguator | ||
//~|NOTE this link resolved to a field, which is not a function | ||
pub struct Foo { | ||
pub bar: u8 | ||
} |
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,15 @@ | ||
error: incompatible link kind for `Foo::bar` | ||
--> $DIR/field-ice.rs:5:6 | ||
| | ||
LL | /// [`Foo::bar()`] | ||
| ^^^^^^^^^^^^ help: to link to the field, remove the disambiguator: ``Foo::bar`` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/field-ice.rs:1:9 | ||
| | ||
LL | #![deny(rustdoc::broken_intra_doc_links)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: this link resolved to a field, which is not a function | ||
|
||
error: aborting due to previous error | ||
|