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