diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-02 17:17:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-02 17:17:33 +0200 |
| commit | 1ce85b1c392f0029200cb62493a16398fb134799 (patch) | |
| tree | 686046b5013a2c0f31ec896b5d006896016eb6f1 | |
| parent | e20b59977b7c8c4fe24ec8c7e1fa3d3138d68b9b (diff) | |
| parent | 099a32bbe4af19568286845ab0a7c439b81fef4f (diff) | |
| download | rust-1ce85b1c392f0029200cb62493a16398fb134799.tar.gz rust-1ce85b1c392f0029200cb62493a16398fb134799.zip | |
Rollup merge of #100025 - tmiasko:rm-transfer-wrapper, r=cjgillot
Remove redundant `TransferWrapper` struct
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/liveness.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/compiler/rustc_mir_dataflow/src/impls/liveness.rs b/compiler/rustc_mir_dataflow/src/impls/liveness.rs index e64136928cc..21132eb991f 100644 --- a/compiler/rustc_mir_dataflow/src/impls/liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/liveness.rs @@ -222,18 +222,6 @@ impl<'a, 'tcx> AnalysisDomain<'tcx> for MaybeTransitiveLiveLocals<'a> { } } -struct TransferWrapper<'a>(&'a mut ChunkedBitSet<Local>); - -impl<'a> GenKill<Local> for TransferWrapper<'a> { - fn gen(&mut self, l: Local) { - self.0.insert(l); - } - - fn kill(&mut self, l: Local) { - self.0.remove(l); - } -} - impl<'a, 'tcx> Analysis<'tcx> for MaybeTransitiveLiveLocals<'a> { fn apply_statement_effect( &self, @@ -271,7 +259,7 @@ impl<'a, 'tcx> Analysis<'tcx> for MaybeTransitiveLiveLocals<'a> { return; } } - TransferFunction(&mut TransferWrapper(trans)).visit_statement(statement, location); + TransferFunction(trans).visit_statement(statement, location); } fn apply_terminator_effect( @@ -280,7 +268,7 @@ impl<'a, 'tcx> Analysis<'tcx> for MaybeTransitiveLiveLocals<'a> { terminator: &mir::Terminator<'tcx>, location: Location, ) { - TransferFunction(&mut TransferWrapper(trans)).visit_terminator(terminator, location); + TransferFunction(trans).visit_terminator(terminator, location); } fn apply_call_return_effect( |
