Skip to content

Commit 1f707db

Browse files
committed
Update messages for clarity when linting
1 parent 2476100 commit 1f707db

File tree

2 files changed

+64
-58
lines changed

2 files changed

+64
-58
lines changed

clippy_lints/src/matches/significant_drop_in_scrutinee.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ pub(super) fn check<'tcx>(
2727
diag.span_label(s, "original temporary lives until here");
2828
if let Some(spans) = has_significant_drop_in_arms(cx, arms) {
2929
for span in spans {
30-
diag.span_label(span, "significant drop in arm here");
30+
diag.span_label(span, "another temporary with significant `Drop` created here");
3131
}
32-
diag.note("this might lead to deadlocks or other unexpected behavior");
3332
}
33+
diag.note("this might lead to deadlocks or other unexpected behavior");
3434
});
3535
}
3636
}
@@ -89,9 +89,9 @@ fn has_significant_drop_in_scrutinee<'tcx, 'a>(
8989
let mut helper = SigDropHelper::new(cx);
9090
helper.find_sig_drop(scrutinee).map(|drops| {
9191
let message = if source == MatchSource::Normal {
92-
"temporary with drop impl with side effects in match scrutinee lives to end of block"
92+
"temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression"
9393
} else {
94-
"temporary with drop impl with side effects in for loop condition lives to end of block"
94+
"temporary with significant `Drop` in `for` loop condition will live until the end of the `for` expression"
9595
};
9696
(drops, message)
9797
})

0 commit comments

Comments
 (0)