Add a test for casts of univariant C-like enums

This commit is contained in:
Anthony Ramine 2018-04-12 15:11:14 +02:00
parent 2807f4f773
commit 7bfe3ae00a

View File

@ -10,8 +10,13 @@
#![allow(dead_code)]
enum X { A = 0 as isize }
enum X { A = 42 as isize }
enum Y { A = X::A as isize }
fn main() { }
fn main() {
let x = X::A;
let x = x as isize;
assert_eq!(x, 42);
assert_eq!(Y::A as isize, 42);
}