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`
This commit is contained in:
commit
cd93be0094
2 changed files with 76 additions and 61 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue