diff options
| author | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-01-13 15:07:12 -0500 |
|---|---|---|
| committer | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-01-13 15:07:12 -0500 |
| commit | e8e32e48c4c52a53d0885ddd8eb972829bbda8e5 (patch) | |
| tree | 3489fa2412f458dfcaefab47bd1cf0166dc8cd4f /src/test | |
| parent | e012a191d768adeda1ee36a99ef8b92d51920154 (diff) | |
| download | rust-e8e32e48c4c52a53d0885ddd8eb972829bbda8e5.tar.gz rust-e8e32e48c4c52a53d0885ddd8eb972829bbda8e5.zip | |
Ignore static lifetimes for GATs outlives lint
Diffstat (limited to 'src/test')
| -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() {} |
