File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::constrained_generic_params as cgp;
1212use rustc:: hir;
1313use rustc:: hir:: itemlikevisit:: ItemLikeVisitor ;
1414use rustc:: hir:: def_id:: DefId ;
15- use rustc:: ty:: { self , TyCtxt } ;
15+ use rustc:: ty:: { self , TyCtxt , TypeFoldable } ;
1616use rustc:: ty:: query:: Providers ;
1717use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
1818use std:: collections:: hash_map:: Entry :: { Occupied , Vacant } ;
@@ -99,8 +99,13 @@ fn enforce_impl_params_are_constrained(
9999) {
100100 // Every lifetime used in an associated type must be constrained.
101101 let impl_self_ty = tcx. type_of ( impl_def_id) ;
102- if impl_self_ty. sty == ty:: Error {
103- // Don't complain about unconstrained type params when self ty doesn't exist. (#36836)
102+ if impl_self_ty. references_error ( ) {
103+ // Don't complain about unconstrained type params when self ty isn't known due to errors.
104+ // (#36836)
105+ tcx. sess . delay_span_bug ( tcx. def_span ( impl_def_id) , & format (
106+ "potentially unconstrained type parameters weren't evaluated on `{:?}`" ,
107+ impl_self_ty,
108+ ) ) ;
104109 return ;
105110 }
106111 let impl_generics = tcx. generics_of ( impl_def_id) ;
You can’t perform that action at this time.
0 commit comments