Skip to content

Commit 519c854

Browse files
committed
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()] | ^^^^^^^^^^^^^^^^^^ ```
1 parent 8e0e925 commit 519c854

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
415415
AnchorFailure::Method
416416
}))
417417
} else {
418-
Ok((ty_res, Some(format!("{}.{}", kind, item_name))))
418+
let res = Res::Def(item.kind.as_def_kind(), item.def_id);
419+
Ok((res, Some(format!("{}.{}", kind, item_name))))
419420
}
420421
} else {
421422
self.variant_field(path_str, current_item, module_id)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#![deny(broken_intra_doc_links_)]
2+
/// Link to [Default::default()]
3+
pub fn f() {}

0 commit comments

Comments
 (0)