Skip to content

Rustup to rust-lang/rust#64736 #4875

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 2 commits into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions clippy_lints/src/redundant_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
) {
let def_id = cx.tcx.hir().body_owner_def_id(body.id());
let mir = cx.tcx.optimized_mir(def_id);
let mir_read_only = mir.unwrap_read_only();

let dead_unwinds = BitSet::new_empty(mir.basic_blocks().len());
let maybe_storage_live_result = do_dataflow(
Expand All @@ -94,7 +95,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
);
let mut possible_borrower = {
let mut vis = PossibleBorrowerVisitor::new(cx, mir);
vis.visit_body(mir);
vis.visit_body(mir_read_only);
vis.into_map(cx, maybe_storage_live_result)
};

Expand Down Expand Up @@ -146,7 +147,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
// `arg` is a reference as it is `.deref()`ed in the previous block.
// Look into the predecessor block and find out the source of deref.

let ps = mir.predecessors_for(bb);
let ps = mir_read_only.predecessors_for(bb);
if ps.len() != 1 {
continue;
}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/custom_ice_message.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// rustc-env:RUST_BACKTRACE=0
// normalize-stderr-test: "Clippy version: .*" -> "Clippy version: foo"
// normalize-stderr-test: "internal_lints.rs:\d*:\d*" -> "internal_lints.rs"
// normalize-stderr-test: "', .*clippy_lints" -> "', clippy_lints"

#![deny(clippy::internal)]

Expand Down