Improve collapsible_match
error message syntax
This commit is contained in:
parent
bfe7f070bd
commit
4e6fc6fa05
@ -96,7 +96,7 @@ fn check_arm<'tcx>(
|
|||||||
// collapsing patterns need an explicit field name in struct pattern matching
|
// collapsing patterns need an explicit field name in struct pattern matching
|
||||||
// ex: Struct {x: Some(1)}
|
// ex: Struct {x: Some(1)}
|
||||||
let replace_msg = if is_innermost_parent_pat_struct {
|
let replace_msg = if is_innermost_parent_pat_struct {
|
||||||
format!(", prefixed by {}:", snippet(cx, binding_span, "their field name"))
|
format!(", prefixed by `{}`:", snippet(cx, binding_span, "their field name"))
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
};
|
};
|
||||||
|
@ -223,7 +223,7 @@ help: the outer pattern can be modified to include the inner pattern
|
|||||||
LL | if let Issue9647::A { a, .. } = x {
|
LL | if let Issue9647::A { a, .. } = x {
|
||||||
| ^ replace this binding
|
| ^ replace this binding
|
||||||
LL | if let Some(u) = a {
|
LL | if let Some(u) = a {
|
||||||
| ^^^^^^^ with this pattern, prefixed by a:
|
| ^^^^^^^ with this pattern, prefixed by `a`:
|
||||||
|
|
||||||
error: this `if let` can be collapsed into the outer `if let`
|
error: this `if let` can be collapsed into the outer `if let`
|
||||||
--> tests/ui/collapsible_match.rs:292:9
|
--> tests/ui/collapsible_match.rs:292:9
|
||||||
|
Loading…
Reference in New Issue
Block a user