Skip to content

Compiler bad error message: E0277 error in Diesel #58968

New issue

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

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

Already on GitHub? # to your account

Open
JCapucho opened this issue Mar 6, 2019 · 2 comments
Open

Compiler bad error message: E0277 error in Diesel #58968

JCapucho opened this issue Mar 6, 2019 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@JCapucho
Copy link

JCapucho commented Mar 6, 2019

I tried this code:

pub fn establish_connection(database_url: &str) -> Pool<PgConnection> {
        let manager = ConnectionManager::<PgConnection>::new(database_url);
        Pool::builder()
                .build(manager)
                .expect(&format!("Error connecting to {}", database_url))
}

And was expecting to get an error message something like:

Expected Pool<ConnectionManager<PgConnection>> got Pool<PgConnection>

Instead i got an misleading error:

the trait `diesel::r2d2::ManageConnection` is not implemented for `diesel::PgConnection`
@Centril Centril added the A-diagnostics Area: Messages for errors, warnings, and lints label Mar 6, 2019
@estebank
Copy link
Contributor

estebank commented Mar 6, 2019

CC @sgrif as per our all-hands conversation, this is something that can be addressed for nightly users using rustc_on_unimplemented.

@estebank estebank changed the title Compiler bad error message Compiler bad error message: E0277 error in Diesel Mar 6, 2019
@crlf0710 crlf0710 added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 11, 2020
@estebank
Copy link
Contributor

estebank commented Aug 3, 2023

We are getting closer to being able to deal with this on stable: #111780

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants