diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/use_self.fixed | 18 | ||||
| -rw-r--r-- | tests/ui/use_self.rs | 16 | ||||
| -rw-r--r-- | tests/ui/use_self.stderr | 8 |
3 files changed, 32 insertions, 10 deletions
diff --git a/tests/ui/use_self.fixed b/tests/ui/use_self.fixed index cccb6bffabb..075e31d202b 100644 --- a/tests/ui/use_self.fixed +++ b/tests/ui/use_self.fixed @@ -530,8 +530,8 @@ mod issue7206 { impl<'a> S2<S<'a>> { fn new_again() -> Self { - Self::new() - //~^ use_self + S2::new() + // FIXME: ^Broken by PR #15611 } } } @@ -755,3 +755,17 @@ mod crash_check_13128 { } } } + +mod issue_13277 { + trait Foo { + type Item<'foo>; + } + struct Bar<'b> { + content: &'b str, + } + impl<'b> Foo for Option<Bar<'b>> { + // when checking whether `Option<Bar<'foo>>` has a lifetime, check not only the outer + // `Option<T>`, but also the inner `Bar<'foo>` + type Item<'foo> = Option<Bar<'foo>>; + } +} diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs index 09288677aa7..6fbba0bbc55 100644 --- a/tests/ui/use_self.rs +++ b/tests/ui/use_self.rs @@ -531,7 +531,7 @@ mod issue7206 { impl<'a> S2<S<'a>> { fn new_again() -> Self { S2::new() - //~^ use_self + // FIXME: ^Broken by PR #15611 } } } @@ -755,3 +755,17 @@ mod crash_check_13128 { } } } + +mod issue_13277 { + trait Foo { + type Item<'foo>; + } + struct Bar<'b> { + content: &'b str, + } + impl<'b> Foo for Option<Bar<'b>> { + // when checking whether `Option<Bar<'foo>>` has a lifetime, check not only the outer + // `Option<T>`, but also the inner `Bar<'foo>` + type Item<'foo> = Option<Bar<'foo>>; + } +} diff --git a/tests/ui/use_self.stderr b/tests/ui/use_self.stderr index 781327696ac..5f65c53ea25 100644 --- a/tests/ui/use_self.stderr +++ b/tests/ui/use_self.stderr @@ -170,12 +170,6 @@ LL | A::new::<submod::B>(submod::B {}) | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> tests/ui/use_self.rs:533:13 - | -LL | S2::new() - | ^^ help: use the applicable keyword: `Self` - -error: unnecessary structure name repetition --> tests/ui/use_self.rs:571:17 | LL | Foo::Bar => unimplemented!(), @@ -259,5 +253,5 @@ error: unnecessary structure name repetition LL | E::A => {}, | ^ help: use the applicable keyword: `Self` -error: aborting due to 43 previous errors +error: aborting due to 42 previous errors |
