@@ -1875,7 +1875,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
18751875 if is_diverging {
18761876 // The signature in this call can reference region variables,
18771877 // so erase them before calling a query.
1878- let output_ty = self . tcx ( ) . erase_regions ( sig. output ( ) ) ;
1878+ let output_ty = self . tcx ( ) . erase_and_anonymize_regions ( sig. output ( ) ) ;
18791879 if !output_ty
18801880 . is_privately_uninhabited ( self . tcx ( ) , self . infcx . typing_env ( self . infcx . param_env ) )
18811881 {
@@ -1969,7 +1969,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19691969
19701970 let op_arg_ty = self . normalize ( op_arg_ty, term_location) ;
19711971 let category = if call_source. from_hir_call ( ) {
1972- ConstraintCategory :: CallArgument ( Some ( self . infcx . tcx . erase_regions ( func_ty) ) )
1972+ ConstraintCategory :: CallArgument ( Some (
1973+ self . infcx . tcx . erase_and_anonymize_regions ( func_ty) ,
1974+ ) )
19731975 } else {
19741976 ConstraintCategory :: Boring
19751977 } ;
@@ -2103,7 +2105,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21032105 // Erase the regions from `ty` to get a global type. The
21042106 // `Sized` bound in no way depends on precise regions, so this
21052107 // shouldn't affect `is_sized`.
2106- let erased_ty = tcx. erase_regions ( ty) ;
2108+ let erased_ty = tcx. erase_and_anonymize_regions ( ty) ;
21072109 // FIXME(#132279): Using `Ty::is_sized` causes us to incorrectly handle opaques here.
21082110 if !erased_ty. is_sized ( tcx, self . infcx . typing_env ( self . infcx . param_env ) ) {
21092111 // in current MIR construction, all non-control-flow rvalue
0 commit comments