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