Skip to content

Commit cd3d38a

Browse files
committed
Use rustc_mir_dataflow::impls::MaybeStorageLive
1 parent 1e68973 commit cd3d38a

File tree

3 files changed

+3
-60
lines changed

3 files changed

+3
-60
lines changed

clippy_utils/src/mir/maybe_storage_live.rs

-52
This file was deleted.

clippy_utils/src/mir/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use rustc_middle::mir::{
55
};
66
use rustc_middle::ty::TyCtxt;
77

8-
mod maybe_storage_live;
9-
108
mod possible_borrower;
119
pub use possible_borrower::PossibleBorrowerMap;
1210

clippy_utils/src/mir/possible_borrower.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
use super::{
2-
maybe_storage_live::MaybeStorageLive, possible_origin::PossibleOriginVisitor,
3-
transitive_relation::TransitiveRelation,
4-
};
1+
use super::{possible_origin::PossibleOriginVisitor, transitive_relation::TransitiveRelation};
52
use crate::ty::is_copy;
63
use rustc_data_structures::fx::FxHashMap;
74
use rustc_index::bit_set::{BitSet, HybridBitSet};
85
use rustc_lint::LateContext;
96
use rustc_middle::mir::{self, visit::Visitor as _, Mutability};
107
use rustc_middle::ty::{self, visit::TypeVisitor};
11-
use rustc_mir_dataflow::{Analysis, ResultsCursor};
8+
use rustc_mir_dataflow::{impls::MaybeStorageLive, Analysis, ResultsCursor};
129
use std::ops::ControlFlow;
1310

1411
/// Collects the possible borrowers of each local.
@@ -182,7 +179,7 @@ impl<'a, 'b, 'tcx> PossibleBorrowerMap<'b, 'tcx> {
182179
vis.visit_body(mir);
183180
vis.into_map(cx)
184181
};
185-
let maybe_storage_live_result = MaybeStorageLive
182+
let maybe_storage_live_result = MaybeStorageLive::new(BitSet::new_empty(mir.local_decls.len()))
186183
.into_engine(cx.tcx, mir)
187184
.pass_name("redundant_clone")
188185
.iterate_to_fixpoint()

0 commit comments

Comments
 (0)