Don't mark associated items as traits

This caused the following false positive:

```
warning: unresolved link to `Default::default`
 --> /home/joshua/rustc2/default.rs:1:14
  |
1 | /// Link to [Default::default()]
  |              ^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
note: this item resolved to a trait, which did not match the disambiguator 'fn'
 --> /home/joshua/rustc2/default.rs:1:14
  |
1 | /// Link to [Default::default()]
  |              ^^^^^^^^^^^^^^^^^^
```
This commit is contained in:
Joshua Nelson 2020-08-02 22:37:21 -04:00
parent 8e0e925e2b
commit 519c85439a
2 changed files with 5 additions and 1 deletions

View File

@ -415,7 +415,8 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
AnchorFailure::Method
}))
} else {
Ok((ty_res, Some(format!("{}.{}", kind, item_name))))
let res = Res::Def(item.kind.as_def_kind(), item.def_id);
Ok((res, Some(format!("{}.{}", kind, item_name))))
}
} else {
self.variant_field(path_str, current_item, module_id)

View File

@ -0,0 +1,3 @@
#![deny(broken_intra_doc_links_)]
/// Link to [Default::default()]
pub fn f() {}