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

Compiler cannot find `diesel::insert_into` for version from Rust package registry. #1261

Closed
anlaakso opened this Issue Oct 17, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@anlaakso

anlaakso commented Oct 17, 2017

Versions

  • Rust:1.22.0-nightly
  • Diesel:0.16.0
  • Database:Postgres
  • Operating System: macOS Sierra

Feature Flags

  • diesel:postgres
  • diesel_codegen:postgres

Problem Description

I have experienced a very specific issue around 'diesel::insert_into' function.
If I run build with dependencies described below

[dependencies]
diesel = { version = "0.16.0", features = ["postgres"] }
diesel_codegen = { version = "0.16.0", features = ["postgres"] }
dotenv = "0.9.0"

the compiler says

error[E0425]: cannot find function `insert_into` in module `diesel`
  --> src/main.rs:31:31
   |
31 |     let rows: usize = diesel::insert_into(example)
   |                               ^^^^^^^^^^^ not found in `diesel`

But if I get diesel directly from GitHub, it works well.

[dependencies]
diesel = { git="https://github.com/diesel-rs/diesel.git", features = ["postgres"] }
diesel_codegen = { version = "0.16.0", features = ["postgres"] }
dotenv = "0.9.0"

@anlaakso anlaakso changed the title from Compiler cannot find `diesel::insert_into` from Rust package registry. to Compiler cannot find `diesel::insert_into` for version from Rust package registry. Oct 17, 2017

@Bobo1239

This comment has been minimized.

Contributor

Bobo1239 commented Oct 17, 2017

insert_into is new and hasn't been published yet (see changelog). The documentation link in the readme tracks the master branch whereas the docs for the released version can be found on e.g. docs.rs.

@anlaakso

This comment has been minimized.

anlaakso commented Oct 17, 2017

Okay, thank you!

@anlaakso anlaakso closed this Oct 17, 2017

@NotBad4U

This comment has been minimized.

NotBad4U commented Nov 2, 2017

@Bobo1239 So I used the master branch in my Cargo.toml

[dependencies]
diesel = { git="https://github.com/diesel-rs/diesel.git", features = ["large-tables", "sqlite", "chrono"] }
diesel_codegen = { version="0.16.0", features = ["sqlite"] }

And when I compile with the feature large-tables. I get this errors:

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
470 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
490 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
511 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
533 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
556 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
580 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
605 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
631 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error[E0194]: type parameter `R` shadows another type parameter of the same name
   --> /home/alessio/.cargo/git/checkouts/diesel-6e3331fb3b9331ec/98d0e98/diesel/src/types/impls/tuples.rs:69:26
    |
69  |                   fn build<R: NamedRow<DB>>(row: &R) -> Result<Self, Box<Error + Send + Sync>> {
    |                            ^ shadows another type parameter
...
432 | / tuple_impls! {
433 | |     17 {
434 | |         (0) -> A, SA, TA,
435 | |         (1) -> B, SB, TB,
...   |
658 | |         (17) -> R, SR, TR,
    | |                 - first `R` declared here
...   |
667 | |     }
668 | | }
    | |_- in this macro invocation

error: aborting due to 9 previous errors

error: Could not compile `diesel`.
@Bobo1239

This comment has been minimized.

Contributor

Bobo1239 commented Nov 2, 2017

@NotBad4U Hm, I'm getting the same error. Unfortunately I don't know what the problem is. Sorry.

@Eijebong

This comment has been minimized.

Member

Eijebong commented Nov 2, 2017

#1290

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