New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overflow evaluating the requirement #1710

Closed
sackery opened this Issue May 21, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@sackery

sackery commented May 21, 2018

let query = diesel::sql_query("SELECT * FROM users WHERE name = ?");
match query.bind::<Text, _>(uid).first::<User>(&*self.db) {
}
error[E0275]: overflow evaluating the requirement `<diesel::query_builder::sql_query::UncheckedBind<diesel::query_builder::SqlQuery, std::string::String, diesel::sql_types::Text> as diesel::query_dsl::limit_dsl::LimitDsl>::Output`
  --> src/vokator/main.rs:99:62
   |
99 |                             match query.bind::<Text, _>(uid).first::<User>(&*self.db) {
   |                                                              ^^^^^
@weiznich

This comment has been minimized.

Contributor

weiznich commented May 21, 2018

Using first with sql_query is not possible, because we could not know if the query already contains a limit clause.
The error message is quite bad, but there is not much we could do about this. (For some reason Rustc simply fails to see that LimitDsl is not implemented for some type. )

@weiznich weiznich closed this May 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment