mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
This commit is contained in:
parent
c7dc961558
commit
4dbd8ad34e
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ use rustc_mir_dataflow::{
|
||||||
fmt::DebugWithContext, impls::MaybeStorageLive, lattice::JoinSemiLattice, Analysis, AnalysisDomain,
|
fmt::DebugWithContext, impls::MaybeStorageLive, lattice::JoinSemiLattice, Analysis, AnalysisDomain,
|
||||||
CallReturnPlaces, ResultsCursor,
|
CallReturnPlaces, ResultsCursor,
|
||||||
};
|
};
|
||||||
|
use std::borrow::Cow;
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
|
|
||||||
/// Collects the possible borrowers of each local.
|
/// Collects the possible borrowers of each local.
|
||||||
|
@ -214,7 +215,7 @@ fn rvalue_locals(rvalue: &mir::Rvalue<'_>, mut visit: impl FnMut(mir::Local)) {
|
||||||
pub struct PossibleBorrowerMap<'b, 'tcx> {
|
pub struct PossibleBorrowerMap<'b, 'tcx> {
|
||||||
body: &'b mir::Body<'tcx>,
|
body: &'b mir::Body<'tcx>,
|
||||||
possible_borrower: ResultsCursor<'b, 'tcx, PossibleBorrowerAnalysis<'b, 'tcx>>,
|
possible_borrower: ResultsCursor<'b, 'tcx, PossibleBorrowerAnalysis<'b, 'tcx>>,
|
||||||
maybe_live: ResultsCursor<'b, 'tcx, MaybeStorageLive>,
|
maybe_live: ResultsCursor<'b, 'tcx, MaybeStorageLive<'b>>,
|
||||||
pushed: BitSet<Local>,
|
pushed: BitSet<Local>,
|
||||||
stack: Vec<Local>,
|
stack: Vec<Local>,
|
||||||
}
|
}
|
||||||
|
@ -231,7 +232,7 @@ impl<'b, 'tcx> PossibleBorrowerMap<'b, 'tcx> {
|
||||||
.pass_name("possible_borrower")
|
.pass_name("possible_borrower")
|
||||||
.iterate_to_fixpoint()
|
.iterate_to_fixpoint()
|
||||||
.into_results_cursor(mir);
|
.into_results_cursor(mir);
|
||||||
let maybe_live = MaybeStorageLive::new(BitSet::new_empty(mir.local_decls.len()))
|
let maybe_live = MaybeStorageLive::new(Cow::Owned(BitSet::new_empty(mir.local_decls.len())))
|
||||||
.into_engine(cx.tcx, mir)
|
.into_engine(cx.tcx, mir)
|
||||||
.pass_name("possible_borrower")
|
.pass_name("possible_borrower")
|
||||||
.iterate_to_fixpoint()
|
.iterate_to_fixpoint()
|
||||||
|
|
Loading…
Add table
Reference in a new issue