Skip to content

Commit 72c1d65

Browse files
Inline krate
1 parent 6f97273 commit 72c1d65

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

compiler/rustc_hir_analysis/src/coherence/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ fn enforce_trait_manually_implementable(
105105
return Err(tcx.dcx().emit_err(errors::ImplOfRestrictedTrait {
106106
impl_span: impl_header_span,
107107
restriction_span: trait_def.impl_restriction.expect_span(),
108-
restriction_path: trait_def
109-
.impl_restriction
110-
.restriction_path(tcx, rustc_hir::def_id::LOCAL_CRATE),
108+
restriction_path: trait_def.impl_restriction.restriction_path(tcx),
111109
}));
112110
}
113111
Ok(())

compiler/rustc_middle/src/ty/trait_def.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ impl ImplRestrictionKind {
133133
}
134134

135135
/// Obtain the path of the restriction. If unrestricted, an empty string is returned.
136-
pub fn restriction_path(self, tcx: TyCtxt<'_>, krate: rustc_span::def_id::CrateNum) -> String {
136+
pub fn restriction_path(self, tcx: TyCtxt<'_>) -> String {
137137
match self {
138138
ImplRestrictionKind::Unrestricted => String::new(),
139139
ImplRestrictionKind::Restricted(restricted_to, _) => {
140-
if restricted_to.krate == krate {
140+
if restricted_to.krate == rustc_hir::def_id::LOCAL_CRATE {
141141
with_crate_prefix!(with_no_trimmed_paths!(tcx.def_path_str(restricted_to)))
142142
} else {
143143
with_no_trimmed_paths!(tcx.def_path_str(restricted_to))

0 commit comments

Comments
 (0)