forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// issue rust-lang/rust#121463 | ||
// ICE non-ADT in struct pattern | ||
#![feature(box_patterns)] | ||
|
||
fn main() { | ||
let mut a = E::StructVar { boxed: Box::new(5_i32) }; | ||
//~^ ERROR failed to resolve: use of undeclared type `E` | ||
match a { | ||
E::StructVar { box boxed } => { } | ||
//~^ ERROR failed to resolve: use of undeclared type `E` | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0433]: failed to resolve: use of undeclared type `E` | ||
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17 | ||
| | ||
LL | let mut a = E::StructVar { boxed: Box::new(5_i32) }; | ||
| ^ | ||
| | | ||
| use of undeclared type `E` | ||
| help: a trait with a similar name exists: `Eq` | ||
|
||
error[E0433]: failed to resolve: use of undeclared type `E` | ||
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9 | ||
| | ||
LL | E::StructVar { box boxed } => { } | ||
| ^ | ||
| | | ||
| use of undeclared type `E` | ||
| help: a trait with a similar name exists: `Eq` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |