summaryrefslogtreecommitdiffstats
path: root/src/test/ui/typeck/issue-98982.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/typeck/issue-98982.rs')
-rw-r--r--src/test/ui/typeck/issue-98982.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/typeck/issue-98982.rs b/src/test/ui/typeck/issue-98982.rs
new file mode 100644
index 000000000..2553824bb
--- /dev/null
+++ b/src/test/ui/typeck/issue-98982.rs
@@ -0,0 +1,9 @@
+fn foo() -> i32 {
+ for i in 0..0 {
+ //~^ ERROR: mismatched types [E0308]
+ return i;
+ }
+ //~| help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
+}
+
+fn main() {}