Providing a trait object as a type parameter to a function causes nonsense error #47990
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
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.
I had mistakenly written this code in crates.io:
conn.transaction::<_, CargoError, _>(...)
(note:CargoError
is a trait). I should have writtenBox<CargoError>
. That resulted in this compiler error, which makes absolutely no sense:I am not invoking the method on a trait object, nor would
use
have any effect as theConnection
trait is already in scope. For reference, the signature of the method being called is:The text was updated successfully, but these errors were encountered: