File tree 1 file changed +8
-3
lines changed
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;
12
12
use rustc:: hir;
13
13
use rustc:: hir:: itemlikevisit:: ItemLikeVisitor ;
14
14
use rustc:: hir:: def_id:: DefId ;
15
- use rustc:: ty:: { self , TyCtxt } ;
15
+ use rustc:: ty:: { self , TyCtxt , TypeFoldable } ;
16
16
use rustc:: ty:: query:: Providers ;
17
17
use rustc:: util:: nodemap:: { FxHashMap , FxHashSet } ;
18
18
use std:: collections:: hash_map:: Entry :: { Occupied , Vacant } ;
@@ -99,8 +99,13 @@ fn enforce_impl_params_are_constrained(
99
99
) {
100
100
// Every lifetime used in an associated type must be constrained.
101
101
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
+ ) ) ;
104
109
return ;
105
110
}
106
111
let impl_generics = tcx. generics_of ( impl_def_id) ;
You can’t perform that action at this time.
0 commit comments