Skip to content

Commit

Permalink
Merge pull request #3528 from weiznich/better_worded_error_message
Browse files Browse the repository at this point in the history
Better wording for a `on_unimplemented` error message
  • Loading branch information
JohnTitor authored Mar 1, 2023
2 parents 7e869e3 + d6eb7e8 commit fa33e38
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion diesel/src/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ pub use diesel_derives::QueryableByName;
#[cfg_attr(
feature = "nightly-error-messages",
rustc_on_unimplemented(
message = "Cannot deserialize a value of the type `{A}` as `{Self}`",
message = "Cannot deserialize a value of the database type `{A}` as `{Self}`",
note = "Double check your type mappings via the documentation of `{A}`"
)
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ error[E0412]: cannot find type `foo` in this scope
27 | #[sql_type = "foo"]
| ^^^^^ not found in this scope

error[E0277]: Cannot deserialize a value of the type `_` as `i32`
error[E0277]: Cannot deserialize a value of the database type `_` as `i32`
--> tests/fail/derive_deprecated/deprecated_sql_type.rs:25:10
|
25 | #[derive(QueryableByName)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0277]: Cannot deserialize a value of the type `diesel::sql_types::Text` as `i32`
error[E0277]: Cannot deserialize a value of the database type `diesel::sql_types::Text` as `i32`
--> tests/fail/select_carries_correct_result_type_info.rs:19:39
|
19 | let ids = select_name.load::<i32>(&mut connection);
Expand All @@ -21,7 +21,7 @@ note: required by a bound in `diesel::RunQueryDsl::load`
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`

error[E0277]: Cannot deserialize a value of the type `diesel::sql_types::Integer` as `*const str`
error[E0277]: Cannot deserialize a value of the database type `diesel::sql_types::Integer` as `*const str`
--> tests/fail/select_carries_correct_result_type_info.rs:20:42
|
20 | let names = select_id.load::<String>(&mut connection);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0277]: Cannot deserialize a value of the type `BigInt` as `*const str`
error[E0277]: Cannot deserialize a value of the database type `BigInt` as `*const str`
--> tests/fail/select_sql_still_ensures_result_type.rs:16:51
|
16 | let count = select_count.get_result::<String>(&mut connection).unwrap();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0277]: Cannot deserialize a value of the type `diesel::sql_types::Text` as `i32`
error[E0277]: Cannot deserialize a value of the database type `diesel::sql_types::Text` as `i32`
--> tests/fail/selectable_with_typemisamatch.rs:17:11
|
17 | name: i32,
Expand All @@ -14,7 +14,7 @@ error[E0277]: Cannot deserialize a value of the type `diesel::sql_types::Text` a
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

error[E0277]: Cannot deserialize a value of the type `diesel::sql_types::Integer` as `*const str`
error[E0277]: Cannot deserialize a value of the database type `diesel::sql_types::Integer` as `*const str`
--> tests/fail/selectable_with_typemisamatch.rs:16:9
|
16 | id: String,
Expand Down

0 comments on commit fa33e38

Please sign in to comment.