mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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:
parent
8e0e925e2b
commit
519c85439a
@ -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)
|
||||
|
3
src/test/rustdoc/intra-link-trait-item.rs
Normal file
3
src/test/rustdoc/intra-link-trait-item.rs
Normal file
@ -0,0 +1,3 @@
|
||||
#![deny(broken_intra_doc_links_)]
|
||||
/// Link to [Default::default()]
|
||||
pub fn f() {}
|
Loading…
Reference in New Issue
Block a user