Skip to content

Commit 903ef47

Browse files
committed
Return early if generator_drop.is_some()
1 parent 610bcea commit 903ef47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clippy_lints/src/redundant_clone.rs

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
8282
let mir = cx.tcx.optimized_mir(def_id);
8383
let mir_read_only = mir.unwrap_read_only();
8484

85+
if mir.generator_drop.is_some() {
86+
return;
87+
}
88+
8589
let maybe_storage_live_result = MaybeStorageLive
8690
.into_engine(cx.tcx, mir, def_id)
8791
.iterate_to_fixpoint()

0 commit comments

Comments
 (0)