diff options
Diffstat (limited to 'tests/ui/return/return-from-diverging.rs')
-rw-r--r-- | tests/ui/return/return-from-diverging.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/return/return-from-diverging.rs b/tests/ui/return/return-from-diverging.rs new file mode 100644 index 000000000..2ee48e7bc --- /dev/null +++ b/tests/ui/return/return-from-diverging.rs @@ -0,0 +1,8 @@ +// Test that return another type in place of ! raises a type mismatch. + +fn fail() -> ! { + return "wow"; //~ ERROR mismatched types +} + +fn main() { +} |