File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
compiler/rustc_hir_analysis/src/check Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1996,13 +1996,17 @@ pub(super) fn check_type_bounds<'tcx>(
19961996 let infcx = tcx. infer_ctxt ( ) . build ( ) ;
19971997 let ocx = ObligationCtxt :: new ( & infcx) ;
19981998
1999- let impl_ty_span = match tcx. hir ( ) . get_by_def_id ( impl_ty_def_id) {
2000- hir:: Node :: TraitItem ( hir:: TraitItem {
2001- kind : hir:: TraitItemKind :: Type ( _, Some ( ty) ) ,
2002- ..
2003- } ) => ty. span ,
2004- hir:: Node :: ImplItem ( hir:: ImplItem { kind : hir:: ImplItemKind :: Type ( ty) , .. } ) => ty. span ,
2005- _ => bug ! ( ) ,
1999+ let impl_ty_span = if tcx. opt_rpitit_info ( impl_ty_def_id) . is_some ( ) {
2000+ tcx. def_span ( impl_ty_def_id)
2001+ } else {
2002+ match tcx. hir ( ) . get_by_def_id ( impl_ty_def_id) {
2003+ hir:: Node :: TraitItem ( hir:: TraitItem {
2004+ kind : hir:: TraitItemKind :: Type ( _, Some ( ty) ) ,
2005+ ..
2006+ } ) => ty. span ,
2007+ hir:: Node :: ImplItem ( hir:: ImplItem { kind : hir:: ImplItemKind :: Type ( ty) , .. } ) => ty. span ,
2008+ _ => bug ! ( ) ,
2009+ }
20062010 } ;
20072011 let assumed_wf_types = ocx. assumed_wf_types ( param_env, impl_ty_span, impl_ty_def_id) ;
20082012
You can’t perform that action at this time.
0 commit comments