diff options
Diffstat (limited to 'tests/ui/return/return-unit-from-diverging.rs')
-rw-r--r-- | tests/ui/return/return-unit-from-diverging.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/return/return-unit-from-diverging.rs b/tests/ui/return/return-unit-from-diverging.rs new file mode 100644 index 000000000..48417599b --- /dev/null +++ b/tests/ui/return/return-unit-from-diverging.rs @@ -0,0 +1,9 @@ +// Test that we get the usual error that we'd get for any other return type and not something about +// diverging functions not being able to return. + +fn fail() -> ! { + return; //~ ERROR in a function whose return type is not +} + +fn main() { +} |