diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-15 11:28:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-15 11:28:25 +0100 |
| commit | cd93be0094a135c55533cb0eba342e5aa1324f00 (patch) | |
| tree | 0b0bbf3ce48cd8099b03af10135faf4bb909de99 /src/test/ui | |
| parent | d878ad0559ed1be0d0a0e3cdc2a62a9480e42cb8 (diff) | |
| parent | e8e32e48c4c52a53d0885ddd8eb972829bbda8e5 (diff) | |
| download | rust-cd93be0094a135c55533cb0eba342e5aa1324f00.tar.gz rust-cd93be0094a135c55533cb0eba342e5aa1324f00.zip | |
Rollup merge of #92865 - jackh726:gats-outlives-no-static, r=nikomatsakis
Ignore static lifetimes for GATs outlives lint cc https://github.com/rust-lang/rust/issues/87479#issuecomment-1010484170 Also included a bit of cleanup of `ty_known_to_outlive` and `region_known_to_outlive` r? `@nikomatsakis`
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/generic-associated-types/self-outlives-lint.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.rs b/src/test/ui/generic-associated-types/self-outlives-lint.rs index 37b3a6155d5..fcc53b4ede0 100644 --- a/src/test/ui/generic-associated-types/self-outlives-lint.rs +++ b/src/test/ui/generic-associated-types/self-outlives-lint.rs @@ -189,4 +189,17 @@ trait Trait: 'static { fn make_assoc(_: &u32) -> Self::Assoc<'_>; } +// We ignore `'static` lifetimes for any lints +trait StaticReturn<'a> { + type Y<'b>; + fn foo(&self) -> Self::Y<'static>; +} + +// Same as above, but with extra method that takes GAT - just make sure this works +trait StaticReturnAndTakes<'a> { + type Y<'b>; + fn foo(&self) -> Self::Y<'static>; + fn bar<'b>(&self, arg: Self::Y<'b>); +} + fn main() {} |
