@@ -1892,7 +1892,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1892
1892
if is_diverging {
1893
1893
// The signature in this call can reference region variables,
1894
1894
// 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 ( ) ) ;
1896
1896
if !output_ty
1897
1897
. is_privately_uninhabited ( self . tcx ( ) , self . infcx . typing_env ( self . infcx . param_env ) )
1898
1898
{
@@ -1986,7 +1986,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1986
1986
1987
1987
let op_arg_ty = self . normalize ( op_arg_ty, term_location) ;
1988
1988
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
+ ) )
1990
1992
} else {
1991
1993
ConstraintCategory :: Boring
1992
1994
} ;
@@ -2120,7 +2122,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2120
2122
// Erase the regions from `ty` to get a global type. The
2121
2123
// `Sized` bound in no way depends on precise regions, so this
2122
2124
// shouldn't affect `is_sized`.
2123
- let erased_ty = tcx. erase_regions ( ty) ;
2125
+ let erased_ty = tcx. erase_and_anonymize_regions ( ty) ;
2124
2126
// FIXME(#132279): Using `Ty::is_sized` causes us to incorrectly handle opaques here.
2125
2127
if !erased_ty. is_sized ( tcx, self . infcx . typing_env ( self . infcx . param_env ) ) {
2126
2128
// in current MIR construction, all non-control-flow rvalue
0 commit comments