Skip to content

Commit 420eae0

Browse files
committed
Mark crash 140011 as fixed
1 parent 06763a6 commit 420eae0

File tree

3 files changed

+49
-11
lines changed

3 files changed

+49
-11
lines changed

tests/crashes/140011.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@compile-flags: -Wrust-2021-incompatible-closure-captures
2+
enum B {
3+
C(D), //~ ERROR: cannot find type `D` in this scope
4+
E(F),
5+
}
6+
struct F;
7+
fn f(h: B) {
8+
|| {
9+
let B::E(a) = h; //~ ERROR: refutable pattern in local binding
10+
};
11+
}
12+
13+
fn main() {}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
error[E0412]: cannot find type `D` in this scope
2+
--> $DIR/malformed-pattern-issue-140011.rs:3:7
3+
|
4+
LL | C(D),
5+
| ^ not found in this scope
6+
|
7+
help: you might be missing a type parameter
8+
|
9+
LL | enum B<D> {
10+
| +++
11+
12+
error[E0005]: refutable pattern in local binding
13+
--> $DIR/malformed-pattern-issue-140011.rs:9:13
14+
|
15+
LL | let B::E(a) = h;
16+
| ^^^^^^^ pattern `B::C(_)` not covered
17+
|
18+
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
19+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
20+
note: `B` defined here
21+
--> $DIR/malformed-pattern-issue-140011.rs:2:6
22+
|
23+
LL | enum B {
24+
| ^
25+
LL | C(D),
26+
| - not covered
27+
= note: the matched value is of type `B`
28+
help: you might want to use `let else` to handle the variant that isn't matched
29+
|
30+
LL | let B::E(a) = h else { todo!() };
31+
| ++++++++++++++++
32+
33+
error: aborting due to 2 previous errors
34+
35+
Some errors have detailed explanations: E0005, E0412.
36+
For more information about an error, try `rustc --explain E0005`.

0 commit comments

Comments
 (0)