From 4547b622d8d29df964fa2914213088b148c498fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:32 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_infer/src/infer/region_constraints/leak_check.rs | 7 ++++--- compiler/rustc_infer/src/infer/region_constraints/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_infer/src/infer/region_constraints') diff --git a/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs b/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs index 90858e307..22b4bbb17 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs @@ -1,6 +1,7 @@ use super::*; use crate::infer::CombinedSnapshot; use rustc_data_structures::{ + fx::FxIndexMap, graph::{scc::Sccs, vec_graph::VecGraph}, undo_log::UndoLogs, }; @@ -371,7 +372,7 @@ rustc_index::newtype_index! { /// an edge `R1 -> R2` in the graph. struct MiniGraph<'tcx> { /// Map from a region to the index of the node in the graph. - nodes: FxHashMap, LeakCheckNode>, + nodes: FxIndexMap, LeakCheckNode>, /// Map from node index to SCC, and stores the successors of each SCC. All /// the regions in the same SCC are equal to one another, and if `S1 -> S2`, @@ -388,7 +389,7 @@ impl<'tcx> MiniGraph<'tcx> { where 'tcx: 'a, { - let mut nodes = FxHashMap::default(); + let mut nodes = FxIndexMap::default(); let mut edges = Vec::new(); // Note that if `R2: R1`, we get a callback `r1, r2`, so `target` is first parameter. @@ -438,7 +439,7 @@ impl<'tcx> MiniGraph<'tcx> { } fn add_node( - nodes: &mut FxHashMap, LeakCheckNode>, + nodes: &mut FxIndexMap, LeakCheckNode>, r: ty::Region<'tcx>, ) -> LeakCheckNode { let l = nodes.len(); diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs index 67b3da687..985c5d360 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs @@ -7,7 +7,7 @@ use super::{ InferCtxtUndoLogs, MiscVariable, RegionVariableOrigin, Rollback, Snapshot, SubregionOrigin, }; -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; +use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_data_structures::intern::Interned; use rustc_data_structures::sync::Lrc; use rustc_data_structures::undo_log::UndoLogs; @@ -125,7 +125,7 @@ pub struct RegionConstraintData<'tcx> { /// we record the fact that `'a <= 'b` is implied by the fn /// signature, and then ignore the constraint when solving /// equations. This is a bit of a hack but seems to work. - pub givens: FxHashSet<(Region<'tcx>, ty::RegionVid)>, + pub givens: FxIndexSet<(Region<'tcx>, ty::RegionVid)>, } /// Represents a constraint that influences the inference process. -- cgit v1.2.3