Skip to content

Commit 2bf213b

Browse files
committed
for_loop_over_fallibles: remove duplication from the message
1 parent 14b8f24 commit 2bf213b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_lint/src/for_loop_over_fallibles.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopOverFallibles {
6969
_ => return,
7070
};
7171

72-
let Ok(arg_snip) = cx.sess().source_map().span_to_snippet(arg.span) else { return };
73-
7472
let msg = format!(
75-
"for loop over `{arg_snip}`, which is {article} `{ty}`. This is more readably written as an `if let` statement",
73+
"for loop over {article} `{ty}`. This is more readably written as an `if let` statement",
7674
);
7775

7876
cx.struct_span_lint(FOR_LOOP_OVER_FALLIBLES, arg.span, |diag| {

0 commit comments

Comments
 (0)