Skip to content
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

Compile fails on latest nightly rust 1.28.0 #1730

Closed
1 of 2 tasks
aario opened this issue May 24, 2018 · 3 comments
Closed
1 of 2 tasks

Compile fails on latest nightly rust 1.28.0 #1730

aario opened this issue May 24, 2018 · 3 comments

Comments

@aario
Copy link

aario commented May 24, 2018

Setup

Versions

  • Rust: 1.28.0-nightly (29ffe51e3 2018-05-23)
  • Diesel: v1.3.0
  • Database: N/A
  • Operating System Debian 8

Feature Flags

  • diesel: N/A

Problem Description

Compile fails:

error[E0277]: the trait bound `<expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Add` is not satisfied
  --> /home/aario/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-1.3.0/src/expression/count.rs:58:39
   |
58 | #[derive(Debug, Clone, Copy, QueryId, DieselNumericOps)]
   |                                       ^^^^^^^^^^^^^^^^ the trait `sql_types::ops::Add` is not implemented for `<expression::count::CountStar as expression::Expression>::SqlType`
   |
   = help: consider adding a `where <expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Add` bound
   = help: see issue #48214
   = help: add #![feature(trivial_bounds)] to the crate attributes to enable

What are you trying to accomplish?

Compile.

What is the expected output?

Compile.

What is the actual output?

Error as in above.

Are you seeing any additional errors?

error[E0277]: the trait bound `<expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Sub` is not satisfied
  --> /home/aario/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-1.3.0/src/expression/count.rs:58:39
   |
58 | #[derive(Debug, Clone, Copy, QueryId, DieselNumericOps)]
   |                                       ^^^^^^^^^^^^^^^^ the trait `sql_types::ops::Sub` is not implemented for `<expression::count::CountStar as expression::Expression>::SqlType`
   |
   = help: consider adding a `where <expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Sub` bound
   = help: see issue #48214
   = help: add #![feature(trivial_bounds)] to the crate attributes to enable

error[E0277]: the trait bound `<expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Mul` is not satisfied
  --> /home/aario/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-1.3.0/src/expression/count.rs:58:39
   |
58 | #[derive(Debug, Clone, Copy, QueryId, DieselNumericOps)]
   |                                       ^^^^^^^^^^^^^^^^ the trait `sql_types::ops::Mul` is not implemented for `<expression::count::CountStar as expression::Expression>::SqlType`
   |
   = help: consider adding a `where <expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Mul` bound
   = help: see issue #48214
   = help: add #![feature(trivial_bounds)] to the crate attributes to enable

error[E0277]: the trait bound `<expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Div` is not satisfied
  --> /home/aario/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-1.3.0/src/expression/count.rs:58:39
   |
58 | #[derive(Debug, Clone, Copy, QueryId, DieselNumericOps)]
   |                                       ^^^^^^^^^^^^^^^^ the trait `sql_types::ops::Div` is not implemented for `<expression::count::CountStar as expression::Expression>::SqlType`
   |
   = help: consider adding a `where <expression::count::CountStar as expression::Expression>::SqlType: sql_types::ops::Div` bound
   = help: see issue #48214
   = help: add #![feature(trivial_bounds)] to the crate attributes to enable

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `diesel`.

Steps to reproduce

rustup --default-toolchain nightly
# try to build any cargo that needs diesel 1.3.0

I tried to compile this:
https://github.com/sean3z/rocket-diesel-rest-api-example

Checklist

  • I have already looked over the issue tracker for similar issues.
  • This issue can be reproduced on Rust's stable channel.
@Eijebong
Copy link
Member

It's a rustc bug, see #1700 #1701 #1705 #1711 #1729, rust-lang/rust#50825 and rust-lang/rust#51042

@theom
Copy link

theom commented May 25, 2018

Since I was using rocket as well, the following solved the issue for me:

$ rustup install nightly-2018-05-05

@bboyadao
Copy link

@theom
have you get it now ?
Error: Rocket codegen requires a more recent version of rustc.
Use rustup update or your preferred method to update Rust.
Installed version is: 1.27.0-nightly (2018-05-04). Minimum required: 1.28.0-nightly (2018-05-30).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants