behavior of '_
around dyn Trait
is wrong
#48468
Labels
A-type-system
Area: Type system
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Generally speaking,
'_
is equivalent to "eliding" a lifetime completely. That is,&'_ T
and&T
are equivalent, as areFoo<'_>
andFoo
(unfortunately). However, there are two cases where this is not true:dyn Trait + '_
-- the object-lifetime-defaulting rules are different, and'_
needs to interact with them (same forTrait
, of course)impl Trait + '_
-- same, but for different reasons@cramertj pointed out that our current behavior around
dyn Trait
is not what we really want:The text was updated successfully, but these errors were encountered: