Skip to content

Commit 751f662

Browse files
committed
add test for ice #121463
Fixes #121463
1 parent 28f60ff commit 751f662

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// issue rust-lang/rust#121463
2+
// ICE non-ADT in struct pattern
3+
#![feature(box_patterns)]
4+
5+
fn main() {
6+
let mut a = E::StructVar { boxed: Box::new(5_i32) };
7+
//~^ ERROR failed to resolve: use of undeclared type `E`
8+
match a {
9+
E::StructVar { box boxed } => { }
10+
//~^ ERROR failed to resolve: use of undeclared type `E`
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0433]: failed to resolve: use of undeclared type `E`
2+
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17
3+
|
4+
LL | let mut a = E::StructVar { boxed: Box::new(5_i32) };
5+
| ^
6+
| |
7+
| use of undeclared type `E`
8+
| help: a trait with a similar name exists: `Eq`
9+
10+
error[E0433]: failed to resolve: use of undeclared type `E`
11+
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9
12+
|
13+
LL | E::StructVar { box boxed } => { }
14+
| ^
15+
| |
16+
| use of undeclared type `E`
17+
| help: a trait with a similar name exists: `Eq`
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0433`.

0 commit comments

Comments
 (0)