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.
Rollup merge of rust-lang#58007 - estebank:issue-58006, r=petrochenkov
Don't panic when accessing enum variant ctor using `Self` in match Fix rust-lang#58006. r? @petrochenkov
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
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
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,15 @@ | ||
#![feature(type_alias_enum_variants)] | ||
pub enum Enum { | ||
A(usize), | ||
} | ||
|
||
impl Enum { | ||
fn foo(&self) -> () { | ||
match self { | ||
Self::A => (), | ||
//~^ ERROR expected unit struct/variant or constant, found tuple variant | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |
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,9 @@ | ||
error[E0533]: expected unit struct/variant or constant, found tuple variant `<Self>::A` | ||
--> $DIR/issue-58006.rs:9:13 | ||
| | ||
LL | Self::A => (), | ||
| ^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0533`. |