@@ -1892,7 +1892,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
18921892 if is_diverging {
18931893 // The signature in this call can reference region variables,
18941894 // so erase them before calling a query.
1895- let output_ty = self . tcx ( ) . erase_regions ( sig. output ( ) ) ;
1895+ let output_ty = self . tcx ( ) . erase_and_anonymize_regions ( sig. output ( ) ) ;
18961896 if !output_ty
18971897 . is_privately_uninhabited ( self . tcx ( ) , self . infcx . typing_env ( self . infcx . param_env ) )
18981898 {
@@ -1986,7 +1986,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19861986
19871987 let op_arg_ty = self . normalize ( op_arg_ty, term_location) ;
19881988 let category = if call_source. from_hir_call ( ) {
1989- ConstraintCategory :: CallArgument ( Some ( self . infcx . tcx . erase_regions ( func_ty) ) )
1989+ ConstraintCategory :: CallArgument ( Some (
1990+ self . infcx . tcx . erase_and_anonymize_regions ( func_ty) ,
1991+ ) )
19901992 } else {
19911993 ConstraintCategory :: Boring
19921994 } ;
@@ -2120,7 +2122,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21202122 // Erase the regions from `ty` to get a global type. The
21212123 // `Sized` bound in no way depends on precise regions, so this
21222124 // shouldn't affect `is_sized`.
2123- let erased_ty = tcx. erase_regions ( ty) ;
2125+ let erased_ty = tcx. erase_and_anonymize_regions ( ty) ;
21242126 // FIXME(#132279): Using `Ty::is_sized` causes us to incorrectly handle opaques here.
21252127 if !erased_ty. is_sized ( tcx, self . infcx . typing_env ( self . infcx . param_env ) ) {
21262128 // in current MIR construction, all non-control-flow rvalue
0 commit comments