mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
simplify emit_outlives_facts
- integrate into `emit_facts` and remove from typeck
This commit is contained in:
parent
1740a5f84a
commit
2024c5d869
@ -124,6 +124,7 @@ pub(crate) fn compute_regions<'a, 'tcx>(
|
||||
borrow_set,
|
||||
move_data,
|
||||
&universal_region_relations,
|
||||
&constraints,
|
||||
);
|
||||
|
||||
let mut regioncx = RegionInferenceContext::new(
|
||||
|
@ -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<AllFacts>,
|
||||
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() {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user