@@ -468,7 +468,7 @@ const ACC_USE: u32 = 4;
468
468
struct Liveness < ' a , ' tcx > {
469
469
ir : & ' a mut IrMaps < ' tcx > ,
470
470
typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
471
- param_env : ty:: ParamEnv < ' tcx > ,
471
+ typing_env : ty:: TypingEnv < ' tcx > ,
472
472
closure_min_captures : Option < & ' tcx RootVariableMinCaptureList < ' tcx > > ,
473
473
successors : IndexVec < LiveNode , Option < LiveNode > > ,
474
474
rwu_table : rwu_table:: RWUTable ,
@@ -491,7 +491,8 @@ struct Liveness<'a, 'tcx> {
491
491
impl < ' a , ' tcx > Liveness < ' a , ' tcx > {
492
492
fn new ( ir : & ' a mut IrMaps < ' tcx > , body_owner : LocalDefId ) -> Liveness < ' a , ' tcx > {
493
493
let typeck_results = ir. tcx . typeck ( body_owner) ;
494
- let param_env = ir. tcx . param_env ( body_owner) ;
494
+ // FIXME(#132279): we're in a body here.
495
+ let typing_env = ty:: TypingEnv :: non_body_analysis ( ir. tcx , body_owner) ;
495
496
let closure_min_captures = typeck_results. closure_min_captures . get ( & body_owner) ;
496
497
let closure_ln = ir. add_live_node ( ClosureNode ) ;
497
498
let exit_ln = ir. add_live_node ( ExitNode ) ;
@@ -502,7 +503,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
502
503
Liveness {
503
504
ir,
504
505
typeck_results,
505
- param_env ,
506
+ typing_env ,
506
507
closure_min_captures,
507
508
successors : IndexVec :: from_elem_n ( None , num_live_nodes) ,
508
509
rwu_table : rwu_table:: RWUTable :: new ( num_live_nodes, num_vars) ,
@@ -1297,7 +1298,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1297
1298
fn check_is_ty_uninhabited ( & mut self , expr : & Expr < ' _ > , succ : LiveNode ) -> LiveNode {
1298
1299
let ty = self . typeck_results . expr_ty ( expr) ;
1299
1300
let m = self . ir . tcx . parent_module ( expr. hir_id ) . to_def_id ( ) ;
1300
- if ty. is_inhabited_from ( self . ir . tcx , m, ty :: TypingEnv :: from_param_env ( self . param_env ) ) {
1301
+ if ty. is_inhabited_from ( self . ir . tcx , m, self . typing_env ) {
1301
1302
return succ;
1302
1303
}
1303
1304
match self . ir . lnks [ succ] {
0 commit comments