Skip to content

Compiler bad error message: E0277 error in Diesel #58968

Description

@JCapucho

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`

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions