mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 11:13:43 +00:00
Add a test for casts of univariant C-like enums
This commit is contained in:
parent
2807f4f773
commit
7bfe3ae00a
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user