Confusing diagnostics where the error mentions Sized but not that a trait bound is not implemented (where it would be for a Sized type). #69719
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This comes from the user forum, playground, moved from #27964:
Error:
Go figure why "library_function doesn't have a size known at compile time".
Analysis:
There is a blanket impl for
Error
onBox<T>
, so quickly looking it up in the docs makes you think that it should implement Error, but it's not onBox<T: ?Sized>
. credit to @yandrosI feel the main issue here is that we have a trait bound on Error that isn't satisfied, so probably it would be nice to replace
library_function
not being sized by:Box<dyn Error> does not implement Error. The following Impls where found: impl<T: Error> Error for Box<T>, but that requires T: Sized
.The text was updated successfully, but these errors were encountered: