diff options
| author | bors <bors@rust-lang.org> | 2025-01-11 18:01:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-11 18:01:44 +0000 |
| commit | eb54a50837ad4bcc9842924f27e7287ca66e294c (patch) | |
| tree | a8dc0d72c151ef4dbf4505e246fe35938f344b4d /compiler/rustc_mir_transform/src/ref_prop.rs | |
| parent | fb65a3ee576feab95a632eb062f466d7a0342310 (diff) | |
| parent | 076c047fe1f18eb8e396b8f2b27ed258393e6f0f (diff) | |
| download | rust-eb54a50837ad4bcc9842924f27e7287ca66e294c.tar.gz rust-eb54a50837ad4bcc9842924f27e7287ca66e294c.zip | |
Auto merge of #135370 - matthiaskrgr:rollup-g2w6d5n, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #134030 (add `-Zmin-function-alignment`) - #134776 (Avoid ICE: Account for `for<'a>` types when checking for non-structural type in constant as pattern) - #135205 (Rename `BitSet` to `DenseBitSet`) - #135314 (Eagerly collect mono items for non-generic closures) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src/ref_prop.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/ref_prop.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/ref_prop.rs b/compiler/rustc_mir_transform/src/ref_prop.rs index 96bcdfa6fac..95b05f94270 100644 --- a/compiler/rustc_mir_transform/src/ref_prop.rs +++ b/compiler/rustc_mir_transform/src/ref_prop.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use rustc_data_structures::fx::FxHashSet; use rustc_index::IndexVec; -use rustc_index::bit_set::BitSet; +use rustc_index::bit_set::DenseBitSet; use rustc_middle::bug; use rustc_middle::mir::visit::*; use rustc_middle::mir::*; @@ -132,7 +132,7 @@ fn compute_replacement<'tcx>( let mut targets = IndexVec::from_elem(Value::Unknown, &body.local_decls); // Set of locals for which we will remove their storage statement. This is useful for // reborrowed references. - let mut storage_to_remove = BitSet::new_empty(body.local_decls.len()); + let mut storage_to_remove = DenseBitSet::new_empty(body.local_decls.len()); let fully_replacable_locals = fully_replacable_locals(ssa); @@ -324,8 +324,8 @@ fn compute_replacement<'tcx>( /// /// We consider a local to be replacable iff it's only used in a `Deref` projection `*_local` or /// non-use position (like storage statements and debuginfo). -fn fully_replacable_locals(ssa: &SsaLocals) -> BitSet<Local> { - let mut replacable = BitSet::new_empty(ssa.num_locals()); +fn fully_replacable_locals(ssa: &SsaLocals) -> DenseBitSet<Local> { + let mut replacable = DenseBitSet::new_empty(ssa.num_locals()); // First pass: for each local, whether its uses can be fully replaced. for local in ssa.locals() { @@ -344,7 +344,7 @@ fn fully_replacable_locals(ssa: &SsaLocals) -> BitSet<Local> { struct Replacer<'tcx> { tcx: TyCtxt<'tcx>, targets: IndexVec<Local, Value<'tcx>>, - storage_to_remove: BitSet<Local>, + storage_to_remove: DenseBitSet<Local>, allowed_replacements: FxHashSet<(Local, Location)>, any_replacement: bool, } |
