Skip to content

Commit 7a943a9

Browse files
committed
Auto merge of #4875 - flip1995:rustup, r=matthiaskrgr
Rustup to rust-lang/rust#64736 cc rust-lang/rust#64736 Fixes #4872 changelog: none
2 parents 574f3fd + 511dece commit 7a943a9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clippy_lints/src/redundant_clone.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
8181
) {
8282
let def_id = cx.tcx.hir().body_owner_def_id(body.id());
8383
let mir = cx.tcx.optimized_mir(def_id);
84+
let mir_read_only = mir.unwrap_read_only();
8485

8586
let dead_unwinds = BitSet::new_empty(mir.basic_blocks().len());
8687
let maybe_storage_live_result = do_dataflow(
@@ -94,7 +95,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
9495
);
9596
let mut possible_borrower = {
9697
let mut vis = PossibleBorrowerVisitor::new(cx, mir);
97-
vis.visit_body(mir);
98+
vis.visit_body(mir_read_only);
9899
vis.into_map(cx, maybe_storage_live_result)
99100
};
100101

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

149-
let ps = mir.predecessors_for(bb);
150+
let ps = mir_read_only.predecessors_for(bb);
150151
if ps.len() != 1 {
151152
continue;
152153
}

tests/ui/custom_ice_message.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// rustc-env:RUST_BACKTRACE=0
22
// normalize-stderr-test: "Clippy version: .*" -> "Clippy version: foo"
33
// normalize-stderr-test: "internal_lints.rs:\d*:\d*" -> "internal_lints.rs"
4+
// normalize-stderr-test: "', .*clippy_lints" -> "', clippy_lints"
45

56
#![deny(clippy::internal)]
67

0 commit comments

Comments
 (0)