summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-init-in-fn-expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/borrowck-init-in-fn-expr.rs')
-rw-r--r--tests/ui/borrowck/borrowck-init-in-fn-expr.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-init-in-fn-expr.rs b/tests/ui/borrowck/borrowck-init-in-fn-expr.rs
new file mode 100644
index 000000000..7eb204a0d
--- /dev/null
+++ b/tests/ui/borrowck/borrowck-init-in-fn-expr.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let f = || -> isize {
+ let i: isize;
+ i //~ ERROR E0381
+ };
+ println!("{}", f());
+}