Error in trait solving #80982
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Related to #78113. In the following example the trait system cannot resolve the trait object
A
inBox<dyn A + 'a>
to Foo, even though Foo implements A:This yields the error:
If we don't provide a lifetime bound in the implementation of A for
&'a Box<dyn A>
(impl<'a> A for &'a Box<dyn A>
) then we get an additional lifetime error since this trait impl is resolved toimpl<'a> A for &'a Box<dyn A + 'static>
, resulting in two errors:The text was updated successfully, but these errors were encountered: