Closed
Description
The following code (playground):
#![feature(generic_associated_types)]
trait Trait: 'static {
type Assoc<'a>;
fn make_assoc(_: &u32) -> Self::Assoc<'_>;
}
Gives an error:
error: Missing required bounds on Assoc
--> src/lib.rs:4:5
|
4 | type Assoc<'a>;
| ^^^^^^^^^^^^^^-
| |
| help: add the required where clauses: `where Self: 'a`
I would have expected the where Self: 'a
not to be required as we already know that Self
outlives 'a
as it outlives 'static
Meta
rustc version: 1.58.0-nightly (e90c5fb 2021-11-12)