Pass on the DefId so rustdoc can name it in suggestions

Look at this beauty:

```rust
error: unresolved link to `S::h`
  --> intra-link-errors.rs:51:6
   |
51 | /// [type@S::h]
   |      ^^^^^^^^^ help: to link to the associated function, use its disambiguator: `S::h()`
   |
   = note: this link resolves to the associated function `h`, which is not in the type namespace
```
This commit is contained in:
Joshua Nelson 2020-08-20 23:05:47 -04:00
parent fcb21999a7
commit 42bed03500
3 changed files with 52 additions and 34 deletions

View file

@ -49,11 +49,18 @@ pub struct S;
pub enum E { A, B, C }
/// [type@S::h]
//~^ ERROR unresolved link
//~| HELP to link to the associated function
//~| NOTE not in the type namespace
impl S {
pub fn h() {}
}
/// [type@T::g]
//~^ ERROR unresolved link
//~| HELP to link to the associated function
//~| NOTE not in the type namespace
/// [T::h!]
pub trait T {
fn g() {}