diff --git a/compiler/rustc_borrowck/src/nll.rs b/compiler/rustc_borrowck/src/nll.rs index d7ea8e1bcc2..2bd067d4161 100644 --- a/compiler/rustc_borrowck/src/nll.rs +++ b/compiler/rustc_borrowck/src/nll.rs @@ -124,6 +124,7 @@ pub(crate) fn compute_regions<'a, 'tcx>( borrow_set, move_data, &universal_region_relations, + &constraints, ); let mut regioncx = RegionInferenceContext::new( diff --git a/compiler/rustc_borrowck/src/polonius/legacy/mod.rs b/compiler/rustc_borrowck/src/polonius/legacy/mod.rs index d1363d98c88..9cf88704e3a 100644 --- a/compiler/rustc_borrowck/src/polonius/legacy/mod.rs +++ b/compiler/rustc_borrowck/src/polonius/legacy/mod.rs @@ -41,6 +41,7 @@ pub(crate) fn emit_facts<'tcx>( borrow_set: &BorrowSet<'tcx>, move_data: &MoveData<'tcx>, universal_region_relations: &UniversalRegionRelations<'tcx>, + constraints: &MirTypeckRegionConstraints<'tcx>, ) { let Some(all_facts) = all_facts else { // We don't do anything if there are no facts to fill. @@ -59,6 +60,7 @@ pub(crate) fn emit_facts<'tcx>( &universal_region_relations.universal_regions, location_table, ); + emit_outlives_facts(all_facts, location_table, constraints); } /// Emit facts needed for move/init analysis: moves and assignments. @@ -198,14 +200,11 @@ pub(crate) fn emit_drop_facts<'tcx>( /// Emit facts about the outlives constraints: the `subset` base relation, i.e. not a transitive /// closure. -pub(crate) fn emit_outlives_facts<'tcx>( - tcx: TyCtxt<'tcx>, - constraints: &MirTypeckRegionConstraints<'tcx>, +fn emit_outlives_facts<'tcx>( + facts: &mut AllFacts, location_table: &LocationTable, - all_facts: &mut Option, + constraints: &MirTypeckRegionConstraints<'tcx>, ) { - let Some(facts) = all_facts else { return }; - let _prof_timer = tcx.prof.generic_activity("polonius_fact_generation"); facts.subset_base.extend(constraints.outlives_constraints.outlives().iter().flat_map( |constraint: &OutlivesConstraint<'_>| { if let Some(from_location) = constraint.locations.from_location() { diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 94ef491814d..20668fc3397 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -59,7 +59,7 @@ use crate::renumber::RegionCtxt; use crate::session_diagnostics::{MoveUnsized, SimdIntrinsicArgConst}; use crate::type_check::free_region_relations::{CreateResult, UniversalRegionRelations}; use crate::universal_regions::{DefiningTy, UniversalRegions}; -use crate::{BorrowckInferCtxt, path_utils, polonius}; +use crate::{BorrowckInferCtxt, path_utils}; macro_rules! span_mirbug { ($context:expr, $elem:expr, $($message:tt)*) => ({ @@ -181,12 +181,6 @@ pub(crate) fn type_check<'a, 'tcx>( liveness::generate(&mut checker, body, &elements, flow_inits, move_data); - polonius::legacy::emit_outlives_facts( - infcx.tcx, - checker.constraints, - location_table, - checker.all_facts, - ); let opaque_type_values = infcx.take_opaque_types(); let opaque_type_values = opaque_type_values