File tree Expand file tree Collapse file tree
rustc_hir_analysis/src/coherence Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ( ) )
Original file line number Diff line number Diff 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) )
You can’t perform that action at this time.
0 commit comments