We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c17777 commit c20a90fCopy full SHA for c20a90f
tests/ui/self/elision/ignore-non-reference-lifetimes.rs
@@ -0,0 +1,22 @@
1
+//@ check-pass
2
+
3
+struct Foo<'a>(&'a str);
4
5
+impl<'b> Foo<'b> {
6
+ fn a<'a>(self: Self, a: &'a str) -> &str {
7
+ a
8
+ }
9
+ fn b<'a>(self: Foo<'b>, a: &'a str) -> &str {
10
11
12
+}
13
14
+struct Foo2<'a>(&'a u32);
15
+impl<'a> Foo2<'a> {
16
+ fn foo(self: &Self) -> &u32 { self.0 } // ok
17
+ fn bar(self: &Foo2<'a>) -> &u32 { self.0 } // ok (do not look into `Foo`)
18
+ fn baz2(self: Self, arg: &u32) -> &u32 { arg } // use lt from `arg`
19
+ fn baz3(self: Foo2<'a>, arg: &u32) -> &u32 { arg } // use lt from `arg`
20
21
22
+fn main() {}
0 commit comments