-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)C-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATs
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)
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)C-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATs