summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs')
-rw-r--r--tests/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs b/tests/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs
new file mode 100644
index 000000000..b9aab2714
--- /dev/null
+++ b/tests/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs
@@ -0,0 +1,13 @@
+// check-pass
+
+fn assert_static<T: 'static>(_: T) {}
+
+// NOTE(eddyb) the `'a: 'a` may look a bit strange, but we *really* want
+// `'a` to be an *early-bound* parameter, otherwise it doesn't matter anyway.
+fn capture_lifetime<'a: 'a>() {}
+
+fn test_lifetime<'a>() {
+ assert_static(capture_lifetime::<'a>);
+}
+
+fn main() {}