summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/mir_check_cast_closure.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/nll/mir_check_cast_closure.rs')
-rw-r--r--src/test/ui/nll/mir_check_cast_closure.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/nll/mir_check_cast_closure.rs b/src/test/ui/nll/mir_check_cast_closure.rs
new file mode 100644
index 000000000..4aebcfdb4
--- /dev/null
+++ b/src/test/ui/nll/mir_check_cast_closure.rs
@@ -0,0 +1,9 @@
+#![allow(dead_code)]
+
+fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
+ let g: fn(_, _) -> _ = |_x, y| y;
+ g
+ //~^ ERROR lifetime may not live long enough
+}
+
+fn main() {}