summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/ty-outlives/impl-trait-captures.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nll/ty-outlives/impl-trait-captures.rs')
-rw-r--r--tests/ui/nll/ty-outlives/impl-trait-captures.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.rs b/tests/ui/nll/ty-outlives/impl-trait-captures.rs
new file mode 100644
index 000000000..67b31b8bc
--- /dev/null
+++ b/tests/ui/nll/ty-outlives/impl-trait-captures.rs
@@ -0,0 +1,15 @@
+// compile-flags:-Zverbose
+
+#![allow(warnings)]
+
+trait Foo<'a> {
+}
+
+impl<'a, T> Foo<'a> for T { }
+
+fn foo<'a, T>(x: &T) -> impl Foo<'a> {
+ x
+ //~^ ERROR captures lifetime that does not appear in bounds
+}
+
+fn main() {}