-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Covariance-related GAT lifetime mismatch #89352
Copy link
Copy link
Closed
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsS-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.Status: Awaiting review from the assignee but also interested parties.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsS-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.Status: Awaiting review from the assignee but also interested parties.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen: Successful compilation.
Instead, this happened: Errors as follows.
Note that it expected and found "type
Sized", which doesn't make sense. Additionally, I don't see what is restricting'sto outlive'a; and indeed, the error can be worked around.Meta
Playground:
The original use-case tied the lifetime parameter of the GAT to the type in typical fashion. Discovered in this URLO thread.
@rustbot label +F-generic_associated_types +A-lifetimes +requires-nightly +A-diagnostics