Compiler error: overflow evaluating the requirement #2892
-
|
Hi! I wanted to use the I don't know why I get this error and I already searched a lot about this error message and I'm not sure whether this is a compiler error or my fault, hoping for the latter. This is the code with the error: let user_id = diesel::sql_query(
"INSERT INTO users (username, password, salt) VALUES (?, ?, ?) RETURNING id",
)
.bind::<VarChar, &str>(username)
.bind::<Blob, &[u8]>(&hpassword)
.bind::<Blob, &[u8]>(&salt)
.first::<models::InsertedUserId>(connection());The Related definitionsDatabase format (
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Thats because |
Beta Was this translation helpful? Give feedback.
Thats because
firstis not a valid method in this context. The required trait bounds for this method are not fulfilled. Useget_resultinstead.The error message is really unfortunate. It would be great if you could fill a issue in the rustc repo for a bad diagnostic in this case. I believe the compiler should be able to point out the missing trait implementation instead emitting this overflow error.