summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-95272.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nll/issue-95272.rs')
-rw-r--r--tests/ui/nll/issue-95272.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/nll/issue-95272.rs b/tests/ui/nll/issue-95272.rs
new file mode 100644
index 000000000..958cbde37
--- /dev/null
+++ b/tests/ui/nll/issue-95272.rs
@@ -0,0 +1,15 @@
+use std::cell::Cell;
+
+fn check<'a, 'b>(x: Cell<&'a ()>, y: Cell<&'b ()>)
+where
+ 'a: 'b,
+{
+}
+
+fn test<'a, 'b>(x: Cell<&'a ()>, y: Cell<&'b ()>) {
+ let f = check;
+ //~^ ERROR lifetime may not live long enough
+ f(x, y);
+}
+
+fn main() {}