summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/issue-58053.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/nll/issue-58053.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-58053.rs b/src/test/ui/nll/issue-58053.rs
new file mode 100644
index 000000000..d5a2fa1a3
--- /dev/null
+++ b/src/test/ui/nll/issue-58053.rs
@@ -0,0 +1,11 @@
+fn main() {
+ let i = &3;
+
+ let f = |x: &i32| -> &i32 { x };
+ //~^ ERROR lifetime may not live long enough
+ let j = f(i);
+
+ let g = |x: &i32| { x };
+ //~^ ERROR lifetime may not live long enough
+ let k = g(i);
+}