From d6eb7e8bea09313dee4e02eac1acf661c755e59b Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 1 Mar 2023 20:40:16 +0100 Subject: [PATCH] Better wording for a `on_unimplemented` error message --- diesel/src/deserialize.rs | 2 +- .../tests/fail/derive_deprecated/deprecated_sql_type.stderr | 2 +- .../tests/fail/select_carries_correct_result_type_info.stderr | 4 ++-- .../tests/fail/select_sql_still_ensures_result_type.stderr | 2 +- .../tests/fail/selectable_with_typemisamatch.stderr | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/diesel/src/deserialize.rs b/diesel/src/deserialize.rs index f5ad09a1a5b7..31028828a0ab 100644 --- a/diesel/src/deserialize.rs +++ b/diesel/src/deserialize.rs @@ -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}`" ) )] diff --git a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr index f29a779f4d04..6db0b7842625 100644 --- a/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr +++ b/diesel_compile_tests/tests/fail/derive_deprecated/deprecated_sql_type.stderr @@ -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)] diff --git a/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr b/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr index 504cf86a0419..258a6e706a81 100644 --- a/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr +++ b/diesel_compile_tests/tests/fail/select_carries_correct_result_type_info.stderr @@ -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::(&mut connection); @@ -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::(&mut connection); diff --git a/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr b/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr index 0c0802d0820c..ecfaec6c6afd 100644 --- a/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr +++ b/diesel_compile_tests/tests/fail/select_sql_still_ensures_result_type.stderr @@ -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::(&mut connection).unwrap(); diff --git a/diesel_compile_tests/tests/fail/selectable_with_typemisamatch.stderr b/diesel_compile_tests/tests/fail/selectable_with_typemisamatch.stderr index e167f6f38fd6..c206f0810ce5 100644 --- a/diesel_compile_tests/tests/fail/selectable_with_typemisamatch.stderr +++ b/diesel_compile_tests/tests/fail/selectable_with_typemisamatch.stderr @@ -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, @@ -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,