@@ -1875,7 +1875,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1875
1875
if is_diverging {
1876
1876
// The signature in this call can reference region variables,
1877
1877
// 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 ( ) ) ;
1879
1879
if !output_ty
1880
1880
. is_privately_uninhabited ( self . tcx ( ) , self . infcx . typing_env ( self . infcx . param_env ) )
1881
1881
{
@@ -1969,7 +1969,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1969
1969
1970
1970
let op_arg_ty = self . normalize ( op_arg_ty, term_location) ;
1971
1971
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
+ ) )
1973
1975
} else {
1974
1976
ConstraintCategory :: Boring
1975
1977
} ;
@@ -2103,7 +2105,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2103
2105
// Erase the regions from `ty` to get a global type. The
2104
2106
// `Sized` bound in no way depends on precise regions, so this
2105
2107
// shouldn't affect `is_sized`.
2106
- let erased_ty = tcx. erase_regions ( ty) ;
2108
+ let erased_ty = tcx. erase_and_anonymize_regions ( ty) ;
2107
2109
// FIXME(#132279): Using `Ty::is_sized` causes us to incorrectly handle opaques here.
2108
2110
if !erased_ty. is_sized ( tcx, self . infcx . typing_env ( self . infcx . param_env ) ) {
2109
2111
// in current MIR construction, all non-control-flow rvalue
0 commit comments