@@ -712,9 +712,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
712
712
) -> bool {
713
713
// Reject any attempt to unify two unevaluated constants that contain inference
714
714
// variables, since inference variables in queries lead to ICEs.
715
- if a. substs . has_infer_types_or_consts ( )
716
- || b. substs . has_infer_types_or_consts ( )
717
- || param_env. has_infer_types_or_consts ( )
715
+ if a. substs . has_non_region_infer ( )
716
+ || b. substs . has_non_region_infer ( )
717
+ || param_env. has_non_region_infer ( )
718
718
{
719
719
debug ! ( "a or b or param_env contain infer vars in its substs -> cannot unify" ) ;
720
720
return false ;
@@ -1734,7 +1734,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1734
1734
1735
1735
// Postpone the evaluation of constants whose substs depend on inference
1736
1736
// variables
1737
- if substs. has_infer_types_or_consts ( ) {
1737
+ if substs. has_non_region_infer ( ) {
1738
1738
let ac = AbstractConst :: new ( self . tcx , unevaluated) ;
1739
1739
match ac {
1740
1740
Ok ( None ) => {
@@ -2072,21 +2072,17 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>(
2072
2072
) -> SubstsRef < ' tcx > {
2073
2073
tcx. mk_substs ( substs. iter ( ) . enumerate ( ) . map ( |( idx, arg) | {
2074
2074
match arg. unpack ( ) {
2075
- GenericArgKind :: Type ( _)
2076
- if arg. has_param_types_or_consts ( ) || arg. has_infer_types_or_consts ( ) =>
2077
- {
2075
+ GenericArgKind :: Type ( _) if arg. has_non_region_param ( ) || arg. has_non_region_infer ( ) => {
2078
2076
tcx. mk_ty ( ty:: Placeholder ( ty:: PlaceholderType {
2079
2077
universe : ty:: UniverseIndex :: ROOT ,
2080
2078
name : ty:: BoundVar :: from_usize ( idx) ,
2081
2079
} ) )
2082
2080
. into ( )
2083
2081
}
2084
- GenericArgKind :: Const ( ct)
2085
- if ct. has_infer_types_or_consts ( ) || ct. has_param_types_or_consts ( ) =>
2086
- {
2082
+ GenericArgKind :: Const ( ct) if ct. has_non_region_infer ( ) || ct. has_non_region_param ( ) => {
2087
2083
let ty = ct. ty ( ) ;
2088
2084
// If the type references param or infer, replace that too...
2089
- if ty. has_param_types_or_consts ( ) || ty. has_infer_types_or_consts ( ) {
2085
+ if ty. has_non_region_param ( ) || ty. has_non_region_infer ( ) {
2090
2086
bug ! ( "const `{ct}`'s type should not reference params or types" ) ;
2091
2087
}
2092
2088
tcx. mk_const ( ty:: ConstS {
0 commit comments