File tree 1 file changed +2
-2
lines changed
compiler/rustc_typeck/src/check
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -894,8 +894,6 @@ pub(super) fn check_impl_items_against_trait<'tcx>(
894
894
impl_trait_ref : ty:: TraitRef < ' tcx > ,
895
895
impl_item_refs : & [ hir:: ImplItemRef < ' _ > ] ,
896
896
) {
897
- let impl_span = tcx. sess . source_map ( ) . guess_head_span ( full_impl_span) ;
898
-
899
897
// If the trait reference itself is erroneous (so the compilation is going
900
898
// to fail), skip checking the items here -- the `impl_item` table in `tcx`
901
899
// isn't populated for such impls.
@@ -1011,6 +1009,8 @@ pub(super) fn check_impl_items_against_trait<'tcx>(
1011
1009
}
1012
1010
1013
1011
if let Ok ( ancestors) = trait_def. ancestors ( tcx, impl_id. to_def_id ( ) ) {
1012
+ let impl_span = tcx. sess . source_map ( ) . guess_head_span ( full_impl_span) ;
1013
+
1014
1014
// Check for missing items from trait
1015
1015
let mut missing_items = Vec :: new ( ) ;
1016
1016
for trait_item in tcx. associated_items ( impl_trait_ref. def_id ) . in_definition_order ( ) {
You can’t perform that action at this time.
0 commit comments