Skip to content

Commit c3d147e

Browse files
Add a guard example for E0416
1 parent 5aa6c15 commit c3d147e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,15 @@ match (1, 2) {
494494
(x, y) => {} // ok!
495495
}
496496
```
497+
498+
Or maybe did you mean to unify? Consider using a guard:
499+
500+
```
501+
match (A, B, C) {
502+
(x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }
503+
(y, z, see) => { /* A and B unequal; do another thing */ }
504+
}
505+
```
497506
"##,
498507

499508
E0417: r##"

0 commit comments

Comments
 (0)