Skip to content
Snippets Groups Projects
Commit 8f4c77c6 authored by David Renshaw's avatar David Renshaw
Browse files

rustup

parent d18d93ba
No related branches found
No related tags found
No related merge requests found
...@@ -686,7 +686,9 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { ...@@ -686,7 +686,9 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
} }
self.write_primval(dest, PrimVal::Bytes(discr_val), dest_ty)?; self.write_primval(dest, PrimVal::Bytes(discr_val), dest_ty)?;
} else { } else {
bug!("rustc only generates Rvalue::Discriminant for enums"); //bug!("rustc only generates Rvalue::Discriminant for enums");
// Getting here is no longer a bug. Is there something else we should be doing?
// See https://github.com/rust-lang/rust/pull/48092.
} }
}, },
} }
......
...@@ -5,8 +5,8 @@ pub enum Foo { ...@@ -5,8 +5,8 @@ pub enum Foo {
fn main() { fn main() {
let f = unsafe { std::mem::transmute::<i32, Foo>(42) }; let f = unsafe { std::mem::transmute::<i32, Foo>(42) };
match f { match f { //~ ERROR invalid enum discriminant value read
Foo::A => {}, //~ ERROR invalid enum discriminant value read Foo::A => {},
Foo::B => {}, Foo::B => {},
Foo::C => {}, Foo::C => {},
Foo::D => {}, Foo::D => {},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment