Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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`
Reacted by pronvis
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
estebank commentedon 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.[-]Compiler bad error message[/-][+]Compiler bad error message: E0277 error in Diesel[/+]estebank commentedon Aug 3, 2023
We are getting closer to being able to deal with this on stable: #111780