Skip to content

Commit 4dbd8ad

Browse files
committed
Address #105659
1 parent c7dc961 commit 4dbd8ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_utils/src/mir/possible_borrower.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use rustc_mir_dataflow::{
1111
fmt::DebugWithContext, impls::MaybeStorageLive, lattice::JoinSemiLattice, Analysis, AnalysisDomain,
1212
CallReturnPlaces, ResultsCursor,
1313
};
14+
use std::borrow::Cow;
1415
use std::ops::ControlFlow;
1516

1617
/// Collects the possible borrowers of each local.
@@ -214,7 +215,7 @@ fn rvalue_locals(rvalue: &mir::Rvalue<'_>, mut visit: impl FnMut(mir::Local)) {
214215
pub struct PossibleBorrowerMap<'b, 'tcx> {
215216
body: &'b mir::Body<'tcx>,
216217
possible_borrower: ResultsCursor<'b, 'tcx, PossibleBorrowerAnalysis<'b, 'tcx>>,
217-
maybe_live: ResultsCursor<'b, 'tcx, MaybeStorageLive>,
218+
maybe_live: ResultsCursor<'b, 'tcx, MaybeStorageLive<'b>>,
218219
pushed: BitSet<Local>,
219220
stack: Vec<Local>,
220221
}
@@ -231,7 +232,7 @@ impl<'b, 'tcx> PossibleBorrowerMap<'b, 'tcx> {
231232
.pass_name("possible_borrower")
232233
.iterate_to_fixpoint()
233234
.into_results_cursor(mir);
234-
let maybe_live = MaybeStorageLive::new(BitSet::new_empty(mir.local_decls.len()))
235+
let maybe_live = MaybeStorageLive::new(Cow::Owned(BitSet::new_empty(mir.local_decls.len())))
235236
.into_engine(cx.tcx, mir)
236237
.pass_name("possible_borrower")
237238
.iterate_to_fixpoint()

0 commit comments

Comments
 (0)