-// compile-flags: -Zunleash-the-miri-inside-of-you
+// compile-flags: -Zunleash-the-miri-inside-of-you -Awarnings
// run-pass
+// miri unleashed warnings are not useful and change frequently, so they are silenced above.
+#![feature(const_panic)]
+
//! Make sure that we read and write enum discriminants correctly for corner cases caused
//! by layout optimizations.
}
let x = Foo::B;
- match x { //~ WARNING skipping const checks
+ match x {
Foo::B => 0,
_ => panic!(),
}
}
if let E1::V2 { .. } = (E1::V1 { f: true }) {
- //~^ WARNING skipping const checks
unreachable!()
}
if let E1::V1 { .. } = (E1::V1 { f: true }) {
- //~^ WARNING skipping const checks
} else {
unreachable!()
}
if let E2::V1 { .. } = E2::V3::<Infallible> {
- //~^ WARNING skipping const checks
unreachable!()
}
if let E2::V3 { .. } = E2::V3::<Infallible> {
- //~^ WARNING skipping const checks
} else {
unreachable!()
}
+++ /dev/null
-warning: skipping const checks
- --> $DIR/enum_discriminants.rs:24:5
- |
-LL | / match x {
-LL | | Foo::B => 0,
-LL | | _ => panic!(),
-LL | | }
- | |_____^
-
-warning: skipping const checks
- --> $DIR/enum_discriminants.rs:88:5
- |
-LL | / if let E1::V2 { .. } = (E1::V1 { f: true }) {
-LL | |
-LL | | unreachable!()
-LL | | }
- | |_____^
-
-warning: skipping const checks
- --> $DIR/enum_discriminants.rs:92:5
- |
-LL | / if let E1::V1 { .. } = (E1::V1 { f: true }) {
-LL | |
-LL | | } else {
-LL | | unreachable!()
-LL | | }
- | |_____^
-
-warning: skipping const checks
- --> $DIR/enum_discriminants.rs:98:5
- |
-LL | / if let E2::V1 { .. } = E2::V3::<Infallible> {
-LL | |
-LL | | unreachable!()
-LL | | }
- | |_____^
-
-warning: skipping const checks
- --> $DIR/enum_discriminants.rs:102:5
- |
-LL | / if let E2::V3 { .. } = E2::V3::<Infallible> {
-LL | |
-LL | | } else {
-LL | | unreachable!()
-LL | | }
- | |_____^
-