File tree 1 file changed +9
-4
lines changed
compiler/rustc_trait_selection/src/traits
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
108
108
FailureKind :: MentionsParam => {
109
109
return Err ( NotConstEvaluatable :: MentionsParam ) ;
110
110
}
111
- _ => ( ) ,
111
+ FailureKind :: Concrete => {
112
+ // Dealt with below by the same code which handles this
113
+ // without the feature gate.
114
+ }
112
115
}
113
116
}
114
117
None => {
@@ -158,10 +161,12 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
158
161
159
162
debug ! ( ?concrete, "is_const_evaluatable" ) ;
160
163
match concrete {
161
- Err ( ErrorHandled :: TooGeneric ) if !substs. has_infer_types_or_consts ( ) => {
162
- Err ( NotConstEvaluatable :: MentionsParam )
164
+ Err ( ErrorHandled :: TooGeneric ) => {
165
+ return Err ( match substs. has_infer_types_or_consts ( ) {
166
+ true => NotConstEvaluatable :: MentionsInfer ,
167
+ false => NotConstEvaluatable :: MentionsParam ,
168
+ } ) ;
163
169
}
164
- Err ( ErrorHandled :: TooGeneric ) => Err ( NotConstEvaluatable :: MentionsInfer ) ,
165
170
Err ( ErrorHandled :: Linted ) => {
166
171
infcx. tcx . sess . delay_span_bug ( span, "constant in type had error reported as lint" ) ;
167
172
Err ( NotConstEvaluatable :: Error ( ErrorReported ) )
You can’t perform that action at this time.
0 commit comments