summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs')
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs b/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
index d9657bac7..5dce8180f 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
+++ b/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
@@ -1,5 +1,4 @@
// aux-build:enums.rs
-// run-pass
extern crate enums;
@@ -7,11 +6,6 @@ use enums::FieldLessWithNonExhaustiveVariant;
fn main() {
let e = FieldLessWithNonExhaustiveVariant::default();
- // FIXME: https://github.com/rust-lang/rust/issues/91161
- // This `as` cast *should* be an error, since it would fail
- // if the non-exhaustive variant got fields. But today it
- // doesn't. The fix for that will update this test to
- // show an error (and not be run-pass any more).
- let d = e as u8;
+ let d = e as u8; //~ ERROR casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid [E0606]
assert_eq!(d, 0);
}