@@ -712,9 +712,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
712712 ) -> bool {
713713 // Reject any attempt to unify two unevaluated constants that contain inference
714714 // 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 ( )
718718 {
719719 debug ! ( "a or b or param_env contain infer vars in its substs -> cannot unify" ) ;
720720 return false ;
@@ -1734,7 +1734,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
17341734
17351735 // Postpone the evaluation of constants whose substs depend on inference
17361736 // variables
1737- if substs. has_infer_types_or_consts ( ) {
1737+ if substs. has_non_region_infer ( ) {
17381738 let ac = AbstractConst :: new ( self . tcx , unevaluated) ;
17391739 match ac {
17401740 Ok ( None ) => {
@@ -2072,21 +2072,17 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>(
20722072) -> SubstsRef < ' tcx > {
20732073 tcx. mk_substs ( substs. iter ( ) . enumerate ( ) . map ( |( idx, arg) | {
20742074 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 ( ) => {
20782076 tcx. mk_ty ( ty:: Placeholder ( ty:: PlaceholderType {
20792077 universe : ty:: UniverseIndex :: ROOT ,
20802078 name : ty:: BoundVar :: from_usize ( idx) ,
20812079 } ) )
20822080 . into ( )
20832081 }
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 ( ) => {
20872083 let ty = ct. ty ( ) ;
20882084 // 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 ( ) {
20902086 bug ! ( "const `{ct}`'s type should not reference params or types" ) ;
20912087 }
20922088 tcx. mk_const ( ty:: ConstS {
0 commit comments