diff options
| author | John Wrenn <john_wrenn@brown.edu> | 2019-05-09 17:08:55 -0400 |
|---|---|---|
| committer | John Wrenn <john_wrenn@brown.edu> | 2019-06-21 11:00:10 -0400 |
| commit | ac98342e846e79985f0c4969a2d546dee24a70d1 (patch) | |
| tree | 8c2ff20debabdd8f9c9f7476f1b2d3868192f6cd /src/test/ui/parser | |
| parent | 38cd9489f75f4a4387296ee304e2287f7c32c211 (diff) | |
| download | rust-ac98342e846e79985f0c4969a2d546dee24a70d1.tar.gz rust-ac98342e846e79985f0c4969a2d546dee24a70d1.zip | |
Implement arbitrary_enum_discriminant
Diffstat (limited to 'src/test/ui/parser')
| -rw-r--r-- | src/test/ui/parser/issue-17383.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-17383.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/parser/tag-variant-disr-non-nullary.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/parser/tag-variant-disr-non-nullary.stderr | 20 |
4 files changed, 21 insertions, 13 deletions
diff --git a/src/test/ui/parser/issue-17383.rs b/src/test/ui/parser/issue-17383.rs index f95005cd914..7bf0e64f2c0 100644 --- a/src/test/ui/parser/issue-17383.rs +++ b/src/test/ui/parser/issue-17383.rs @@ -1,6 +1,6 @@ enum X { A = 3, - //~^ ERROR custom discriminant values are not allowed in enums with fields + //~^ ERROR custom discriminant values are not allowed in enums with tuple or struct variants B(usize) } diff --git a/src/test/ui/parser/issue-17383.stderr b/src/test/ui/parser/issue-17383.stderr index 37abd0ff5e1..486c4055807 100644 --- a/src/test/ui/parser/issue-17383.stderr +++ b/src/test/ui/parser/issue-17383.stderr @@ -1,11 +1,15 @@ -error: custom discriminant values are not allowed in enums with fields +error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants --> $DIR/issue-17383.rs:2:9 | LL | A = 3, - | ^ invalid custom discriminant + | ^ disallowed custom discriminant LL | LL | B(usize) - | -------- variant with a field defined here + | -------- tuple variant defined here + | + = note: for more information, see https://github.com/rust-lang/rust/issues/60553 + = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable error: aborting due to previous error +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.rs b/src/test/ui/parser/tag-variant-disr-non-nullary.rs index 305edc4ad5a..a9cfdd549c7 100644 --- a/src/test/ui/parser/tag-variant-disr-non-nullary.rs +++ b/src/test/ui/parser/tag-variant-disr-non-nullary.rs @@ -1,6 +1,6 @@ enum Color { Red = 0xff0000, - //~^ ERROR custom discriminant values are not allowed in enums with fields + //~^ ERROR custom discriminant values are not allowed in enums with tuple or struct variants Green = 0x00ff00, Blue = 0x0000ff, Black = 0x000000, diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr index 2d3b2839531..13b46c6e8b3 100644 --- a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr +++ b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr @@ -1,21 +1,25 @@ -error: custom discriminant values are not allowed in enums with fields +error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants --> $DIR/tag-variant-disr-non-nullary.rs:2:11 | LL | Red = 0xff0000, - | ^^^^^^^^ invalid custom discriminant + | ^^^^^^^^ disallowed custom discriminant LL | LL | Green = 0x00ff00, - | ^^^^^^^^ invalid custom discriminant + | ^^^^^^^^ disallowed custom discriminant LL | Blue = 0x0000ff, - | ^^^^^^^^ invalid custom discriminant + | ^^^^^^^^ disallowed custom discriminant LL | Black = 0x000000, - | ^^^^^^^^ invalid custom discriminant + | ^^^^^^^^ disallowed custom discriminant LL | White = 0xffffff, - | ^^^^^^^^ invalid custom discriminant + | ^^^^^^^^ disallowed custom discriminant LL | Other(usize), - | ------------ variant with a field defined here + | ------------ tuple variant defined here LL | Other2(usize, usize), - | -------------------- variant with fields defined here + | -------------------- tuple variant defined here + | + = note: for more information, see https://github.com/rust-lang/rust/issues/60553 + = help: add #![feature(arbitrary_enum_discriminant)] to the crate attributes to enable error: aborting due to previous error +For more information about this error, try `rustc --explain E0658`. |
