rustdoc: Do not add external traits to the crate in register_res
It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits.
This commit is contained in:
parent
fab0432952
commit
59b8ff97b2
@ -7,7 +7,6 @@ use crate::clean::{
|
||||
PathSegment, Primitive, PrimitiveType, Type, TypeBinding, Visibility,
|
||||
};
|
||||
use crate::core::DocContext;
|
||||
use crate::formats::item_type::ItemType;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_ast::tokenstream::TokenTree;
|
||||
@ -503,9 +502,6 @@ pub(crate) fn register_res(cx: &mut DocContext<'_>, res: Res) -> DefId {
|
||||
return did;
|
||||
}
|
||||
inline::record_extern_fqn(cx, did, kind);
|
||||
if let ItemType::Trait = kind {
|
||||
inline::record_extern_trait(cx, did);
|
||||
}
|
||||
did
|
||||
}
|
||||
|
||||
|
4
src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs
Normal file
4
src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs
Normal file
@ -0,0 +1,4 @@
|
||||
pub trait Trait {
|
||||
/// [`u8::clone`]
|
||||
fn method();
|
||||
}
|
8
src/test/rustdoc/intra-doc/issue-103463.rs
Normal file
8
src/test/rustdoc/intra-doc/issue-103463.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// The `Trait` is not pulled into the crate resulting in doc links in its methods being resolved.
|
||||
|
||||
// aux-build:issue-103463-aux.rs
|
||||
|
||||
extern crate issue_103463_aux;
|
||||
use issue_103463_aux::Trait;
|
||||
|
||||
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user