suggest removing disambiguator if linking to field

This commit is contained in:
Deadbeef 2021-07-12 19:04:51 +08:00
parent e97c29bda2
commit 3dab2d210f
No known key found for this signature in database
GPG key ID: 6525773485376D92
3 changed files with 32 additions and 0 deletions

View file

@ -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
}

View file

@ -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