Closed

Description
This program incorrectly prints "second branch" even though the match expression should fail.
extern crate core;
use core::mem;
enum Value {
Val1,
Val2
}
fn main() {
let mut value = Val2;
unsafe { *mem::transmute::<&mut Value, &mut int>(&mut value) += 10; }
match value {
Val1 => println!("first branch"),
Val2 => println!("second branch")
}
}
Metadata
Metadata
Assignees
Labels
No labels