diff options
Diffstat (limited to 'tests/ui/coercion/coerce-to-bang-cast.rs')
-rw-r--r-- | tests/ui/coercion/coerce-to-bang-cast.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/coercion/coerce-to-bang-cast.rs b/tests/ui/coercion/coerce-to-bang-cast.rs new file mode 100644 index 000000000..85598a42e --- /dev/null +++ b/tests/ui/coercion/coerce-to-bang-cast.rs @@ -0,0 +1,12 @@ +#![feature(never_type)] + +fn cast_a() { + let y = {return; 22} as !; + //~^ ERROR non-primitive cast +} + +fn cast_b() { + let y = 22 as !; //~ ERROR non-primitive cast +} + +fn main() { } |