diff options
Diffstat (limited to 'tests/ui/never_type/cast-never.rs')
-rw-r--r-- | tests/ui/never_type/cast-never.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/never_type/cast-never.rs b/tests/ui/never_type/cast-never.rs new file mode 100644 index 000000000..0139ebe46 --- /dev/null +++ b/tests/ui/never_type/cast-never.rs @@ -0,0 +1,10 @@ +// Test that we can explicitly cast ! to another type + +// check-pass + +#![feature(never_type)] + +fn main() { + let x: ! = panic!(); + let y: u32 = x as u32; +} |