Skip to content

Commit 45720b7

Browse files
committed
Auto merge of rust-lang#13284 - sobolevn:issue-13283, r=y21
Improve `collapsible_match` error message syntax fixes rust-lang#13283 changelog: none
2 parents bfe7f07 + 4e6fc6f commit 45720b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/matches/collapsible_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn check_arm<'tcx>(
9696
// collapsing patterns need an explicit field name in struct pattern matching
9797
// ex: Struct {x: Some(1)}
9898
let replace_msg = if is_innermost_parent_pat_struct {
99-
format!(", prefixed by {}:", snippet(cx, binding_span, "their field name"))
99+
format!(", prefixed by `{}`:", snippet(cx, binding_span, "their field name"))
100100
} else {
101101
String::new()
102102
};

tests/ui/collapsible_match.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ help: the outer pattern can be modified to include the inner pattern
223223
LL | if let Issue9647::A { a, .. } = x {
224224
| ^ replace this binding
225225
LL | if let Some(u) = a {
226-
| ^^^^^^^ with this pattern, prefixed by a:
226+
| ^^^^^^^ with this pattern, prefixed by `a`:
227227

228228
error: this `if let` can be collapsed into the outer `if let`
229229
--> tests/ui/collapsible_match.rs:292:9

0 commit comments

Comments
 (0)