Closed
Description
I had mistakenly written this code in crates.io: conn.transaction::<_, CargoError, _>(...)
(note: CargoError
is a trait). I should have written Box<CargoError>
. That resulted in this compiler error, which makes absolutely no sense:
error: the `transaction` method cannot be invoked on a trait object
--> src/user/mod.rs:546:10
|
546 | conn.transaction::<_, CargoError, _>(|| {
| ^^^^^^^^^^^
|
= note: another candidate was found in the following trait, perhaps add a `use` for it:
candidate #1: `use diesel::Connection;`
I am not invoking the method on a trait object, nor would use
have any effect as the Connection
trait is already in scope. For reference, the signature of the method being called is:
fn transaction<T, E, F>(&self, f: F) -> Result<T, E>
where
F: FnOnce() -> Result<T, E>,
E: From<Error>,