diff options
| author | bors <bors@rust-lang.org> | 2022-05-31 21:06:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-31 21:06:11 +0000 |
| commit | e0944922007e1bb4fe59809293acf4364410cccc (patch) | |
| tree | ce23d3b4d851362df6a0ab4f0637de8ea605aa7f /compiler/rustc_mir_transform/src | |
| parent | 0595ea1d12cf745e0a672d05341429ecb0917e66 (diff) | |
| parent | dff602fc18be295d1b87196a6eee1c72673e6bb8 (diff) | |
| download | rust-e0944922007e1bb4fe59809293acf4364410cccc.tar.gz rust-e0944922007e1bb4fe59809293acf4364410cccc.zip | |
Auto merge of #97582 - tmiasko:pointer-address-cast, r=oli-obk
Add a pointer to address cast kind A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/dead_store_elimination.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/dead_store_elimination.rs b/compiler/rustc_mir_transform/src/dead_store_elimination.rs index 84f2ee639e4..8becac34ed7 100644 --- a/compiler/rustc_mir_transform/src/dead_store_elimination.rs +++ b/compiler/rustc_mir_transform/src/dead_store_elimination.rs @@ -24,7 +24,7 @@ use rustc_mir_dataflow::{impls::MaybeTransitiveLiveLocals, Analysis}; /// The `borrowed` set must be a `BitSet` of all the locals that are ever borrowed in this body. It /// can be generated via the [`get_borrowed_locals`] function. pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>, borrowed: &BitSet<Local>) { - let mut live = MaybeTransitiveLiveLocals::new(borrowed, &body.local_decls, tcx) + let mut live = MaybeTransitiveLiveLocals::new(borrowed) .into_engine(tcx, body) .iterate_to_fixpoint() .into_results_cursor(body); @@ -34,7 +34,7 @@ pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>, borrowed: &BitS for (statement_index, statement) in bb_data.statements.iter().enumerate().rev() { let loc = Location { block: bb, statement_index }; if let StatementKind::Assign(assign) = &statement.kind { - if assign.1.is_pointer_int_cast(&body.local_decls, tcx) { + if assign.1.is_pointer_int_cast() { continue; } } |
