Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: Do not add external traits to the crate in register_res #103649

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}

Expand Down
4 changes: 4 additions & 0 deletions src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub trait Trait {
/// [`u8::clone`]
fn method();
}
8 changes: 8 additions & 0 deletions src/test/rustdoc/intra-doc/issue-103463.rs
Original file line number Diff line number Diff line change
@@ -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() {}