mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
Change Successors
to impl Iterator<Item = BasicBlock>
This commit is contained in:
parent
198c70daab
commit
d7a6654580
1 changed files with 2 additions and 2 deletions
|
@ -114,7 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantClone {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give up on loops
|
// Give up on loops
|
||||||
if terminator.successors().any(|s| *s == bb) {
|
if terminator.successors().any(|s| s == bb) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@ fn visit_clone_usage(cloned: mir::Local, clone: mir::Local, mir: &mir::Body<'_>,
|
||||||
// Short-circuit
|
// Short-circuit
|
||||||
if (usage.cloned_used && usage.clone_consumed_or_mutated) ||
|
if (usage.cloned_used && usage.clone_consumed_or_mutated) ||
|
||||||
// Give up on loops
|
// Give up on loops
|
||||||
tdata.terminator().successors().any(|s| *s == bb)
|
tdata.terminator().successors().any(|s| s == bb)
|
||||||
{
|
{
|
||||||
return CloneUsage {
|
return CloneUsage {
|
||||||
cloned_used: true,
|
cloned_used: true,
|
||||||
|
|
Loading…
Reference in a new issue