summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/user-annotations/wf-self-type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nll/user-annotations/wf-self-type.rs')
-rw-r--r--tests/ui/nll/user-annotations/wf-self-type.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/nll/user-annotations/wf-self-type.rs b/tests/ui/nll/user-annotations/wf-self-type.rs
new file mode 100644
index 000000000..539226aab
--- /dev/null
+++ b/tests/ui/nll/user-annotations/wf-self-type.rs
@@ -0,0 +1,13 @@
+struct Foo<'a, 'b: 'a>(&'a &'b ());
+
+impl<'a, 'b> Foo<'a, 'b> {
+ fn xmute(a: &'b ()) -> &'a () {
+ unreachable!()
+ }
+}
+
+pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
+ Foo::xmute(u) //~ ERROR lifetime may not live long enough
+}
+
+fn main() {}