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

Diesel 2.0 released with errors when updating #57

Open
tyler-harpool opened this issue Sep 3, 2022 · 0 comments
Open

Diesel 2.0 released with errors when updating #57

tyler-harpool opened this issue Sep 3, 2022 · 0 comments

Comments

@tyler-harpool
Copy link

tyler-harpool commented Sep 3, 2022

Diesel updated with version 2.0

Updated Cargo.toml

diesel = { version = "2.0.0", features = ["postgres", "uuid", "chrono", "r2d2"] }

See these errors:

warning: #[table_name] attribute form is deprecated
  = help: use `#[diesel(table_name = users)]` instead

error[E0308]: mismatched types
    --> src/user/service/list.rs:18:23
     |
18   |         .load::<User>(conn)?)
     |          ------------ ^^^^ types differ in mutability
     |          |
     |          arguments to this function are incorrect
     |
     = note: expected mutable reference `&mut _`
                        found reference `&diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::PgConnection>>`
note: associated function defined here
    --> /home//.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-2.0.0/src/query_dsl/mod.rs:1497:8
     |
1497 |     fn load<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>
     |        ^^^^

error[E0308]: mismatched types
    --> src/user/service/login.rs:18:24
     |
18   |         .first::<User>(conn)
     |          ------------- ^^^^ types differ in mutability
     |          |
     |          arguments to this function are incorrect
     |
     = note: expected mutable reference `&mut _`
                        found reference `&diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::PgConnection>>`
note: associated function defined here
    --> /home//.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-2.0.0/src/query_dsl/mod.rs:1733:8
     |
1733 |     fn first<'query, U>(self, conn: &mut Conn) -> QueryResult<U>
     |        ^^^^^

error[E0308]: mismatched types
    --> src/user/service/register.rs:16:83
     |
16   |     let inserted_user: User = diesel::insert_into(users).values(&user).get_result(conn)?;
     |                                                                        ---------- ^^^^ types differ in mutability
     |                                                                        |
     |                                                                        arguments to this function are incorrect
     |
     = note: expected mutable reference `&mut _`
                        found reference `&diesel::PgConnection`
note: associated function defined here
    --> /home//.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-2.0.0/src/query_dsl/mod.rs:1677:8
     |
1677 |     fn get_result<'query, U>(self, conn: &mut Conn) -> QueryResult<U>
     |        ^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `canduma` due to 3 previous errors
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

1 participant