Skip to content

Remove redundant TransferWrapper struct #100025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions compiler/rustc_mir_dataflow/src/impls/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down