File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
compiler/rustc_typeck/src/check Expand file tree Collapse file tree 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>(
894894 impl_trait_ref : ty:: TraitRef < ' tcx > ,
895895 impl_item_refs : & [ hir:: ImplItemRef < ' _ > ] ,
896896) {
897- let impl_span = tcx. sess . source_map ( ) . guess_head_span ( full_impl_span) ;
898-
899897 // If the trait reference itself is erroneous (so the compilation is going
900898 // to fail), skip checking the items here -- the `impl_item` table in `tcx`
901899 // isn't populated for such impls.
@@ -1011,6 +1009,8 @@ pub(super) fn check_impl_items_against_trait<'tcx>(
10111009 }
10121010
10131011 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+
10141014 // Check for missing items from trait
10151015 let mut missing_items = Vec :: new ( ) ;
10161016 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