Cannot coerce dyn Trait<'short> + 'long
to dyn Trait<'long> + 'long
#139457
Labels
A-lifetimes
Area: Lifetimes / regions
A-trait-objects
Area: trait objects, vtable layout
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: It compiles. The concrete type of the
dyn Trait<'short> + 'long
cannot mention'short
(as it lives for all of'long
), so it must implementTrait<'long>
also.Instead, this happened:
Meta
rustc --version
:@rustbot label A-lifetimes A-trait-objects T-types
The text was updated successfully, but these errors were encountered: