1
1
use super :: { InferCtxt , FixupError , FixupResult , Span } ;
2
2
use super :: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
3
3
use crate :: mir:: interpret:: ConstValue ;
4
- use crate :: ty:: { self , Ty , Const , TyCtxt , TypeFoldable , InferConst , TypeFlags } ;
4
+ use crate :: ty:: { self , Ty , Const , TyCtxt , TypeFoldable , InferConst } ;
5
5
use crate :: ty:: fold:: { TypeFolder , TypeVisitor } ;
6
6
7
7
///////////////////////////////////////////////////////////////////////////
@@ -29,7 +29,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticVarResolver<'a, 'tcx> {
29
29
}
30
30
31
31
fn fold_ty ( & mut self , t : Ty < ' tcx > ) -> Ty < ' tcx > {
32
- if !t. has_infer_types ( ) {
32
+ if !t. has_infer_types ( ) && !t . has_infer_consts ( ) {
33
33
t // micro-optimize -- if there is nothing in this type that this fold affects...
34
34
} else {
35
35
let t = self . infcx . shallow_resolve ( t) ;
@@ -38,7 +38,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticVarResolver<'a, 'tcx> {
38
38
}
39
39
40
40
fn fold_const ( & mut self , ct : & ' tcx Const < ' tcx > ) -> & ' tcx Const < ' tcx > {
41
- if !ct. has_type_flags ( TypeFlags :: HAS_CT_INFER ) {
41
+ if !ct. has_infer_consts ( ) {
42
42
ct // micro-optimize -- if there is nothing in this const that this fold affects...
43
43
} else {
44
44
let ct = self . infcx . shallow_resolve ( ct) ;
0 commit comments