From fd0101afb2579b3d4ec1272cad7951add3a5a7fb Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 1 Jan 2021 03:16:31 +0100 Subject: [PATCH] Update some postgres trybuild tests --- tests/ui/postgres/gated/chrono.stderr | 16 ++++----- tests/ui/postgres/issue_30.stderr | 2 +- tests/ui/postgres/wrong_param_type.stderr | 44 ++++++++++------------- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/tests/ui/postgres/gated/chrono.stderr b/tests/ui/postgres/gated/chrono.stderr index c6f42af4..51c0d301 100644 --- a/tests/ui/postgres/gated/chrono.stderr +++ b/tests/ui/postgres/gated/chrono.stderr @@ -1,4 +1,4 @@ -error: optional feature `chrono` required for type DATE of column #1 ("now") +error: optional feature `time` required for type DATE of column #1 ("now") --> $DIR/chrono.rs:2:13 | 2 | let _ = sqlx::query!("select now()::date"); @@ -6,7 +6,7 @@ error: optional feature `chrono` required for type DATE of column #1 ("now") | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type TIME of column #1 ("now") +error: optional feature `time` required for type TIME of column #1 ("now") --> $DIR/chrono.rs:4:13 | 4 | let _ = sqlx::query!("select now()::time"); @@ -14,7 +14,7 @@ error: optional feature `chrono` required for type TIME of column #1 ("now") | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type TIMESTAMP of column #1 ("now") +error: optional feature `time` required for type TIMESTAMP of column #1 ("now") --> $DIR/chrono.rs:6:13 | 6 | let _ = sqlx::query!("select now()::timestamp"); @@ -22,7 +22,7 @@ error: optional feature `chrono` required for type TIMESTAMP of column #1 ("now" | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type TIMESTAMPTZ of column #1 ("now") +error: optional feature `time` required for type TIMESTAMPTZ of column #1 ("now") --> $DIR/chrono.rs:8:13 | 8 | let _ = sqlx::query!("select now()::timestamptz"); @@ -30,7 +30,7 @@ error: optional feature `chrono` required for type TIMESTAMPTZ of column #1 ("no | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type DATE of param #1 +error: optional feature `time` required for type DATE of param #1 --> $DIR/chrono.rs:10:13 | 10 | let _ = sqlx::query!("select $1::date", ()); @@ -38,7 +38,7 @@ error: optional feature `chrono` required for type DATE of param #1 | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type TIME of param #1 +error: optional feature `time` required for type TIME of param #1 --> $DIR/chrono.rs:12:13 | 12 | let _ = sqlx::query!("select $1::time", ()); @@ -46,7 +46,7 @@ error: optional feature `chrono` required for type TIME of param #1 | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type TIMESTAMP of param #1 +error: optional feature `time` required for type TIMESTAMP of param #1 --> $DIR/chrono.rs:14:13 | 14 | let _ = sqlx::query!("select $1::timestamp", ()); @@ -54,7 +54,7 @@ error: optional feature `chrono` required for type TIMESTAMP of param #1 | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: optional feature `chrono` required for type TIMESTAMPTZ of param #1 +error: optional feature `time` required for type TIMESTAMPTZ of param #1 --> $DIR/chrono.rs:16:13 | 16 | let _ = sqlx::query!("select $1::timestamptz", ()); diff --git a/tests/ui/postgres/issue_30.stderr b/tests/ui/postgres/issue_30.stderr index 8ed7261a..66dd2030 100644 --- a/tests/ui/postgres/issue_30.stderr +++ b/tests/ui/postgres/issue_30.stderr @@ -1,4 +1,4 @@ -error: "\'1" is not a valid Rust identifier +error: column name "\'1" is invalid: "\'1" is not a valid Rust identifier --> $DIR/issue_30.rs:2:17 | 2 | let query = sqlx::query!("select 1 as \"'1\""); diff --git a/tests/ui/postgres/wrong_param_type.stderr b/tests/ui/postgres/wrong_param_type.stderr index 706dbd3d..50274e12 100644 --- a/tests/ui/postgres/wrong_param_type.stderr +++ b/tests/ui/postgres/wrong_param_type.stderr @@ -1,55 +1,47 @@ error[E0308]: mismatched types - --> $DIR/wrong_param_type.rs:2:18 + --> $DIR/wrong_param_type.rs:2:50 | 2 | let _query = sqlx::query!("select $1::text", 0i32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `i32` - | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + | ^^^^ expected `&str`, found `i32` error[E0308]: mismatched types - --> $DIR/wrong_param_type.rs:4:18 + --> $DIR/wrong_param_type.rs:4:50 | 4 | let _query = sqlx::query!("select $1::text", &0i32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found `i32` + | ^ expected `str`, found `i32` | = note: expected reference `&str` found reference `&i32` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> $DIR/wrong_param_type.rs:6:18 + --> $DIR/wrong_param_type.rs:6:50 | 6 | let _query = sqlx::query!("select $1::text", Some(0i32)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `i32` + | ^^^^ expected `&str`, found `i32` | - = note: expected enum `std::option::Option<&str>` - found enum `std::option::Option` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: expected enum `Option<&str>` + found enum `Option` error[E0308]: mismatched types - --> $DIR/wrong_param_type.rs:9:18 + --> $DIR/wrong_param_type.rs:9:50 | 9 | let _query = sqlx::query!("select $1::text", arg); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `i32` - | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + | ^^^ expected `&str`, found `i32` error[E0308]: mismatched types - --> $DIR/wrong_param_type.rs:12:18 + --> $DIR/wrong_param_type.rs:12:50 | 12 | let _query = sqlx::query!("select $1::text", arg); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `i32` + | ^^^ expected `&str`, found `i32` | - = note: expected enum `std::option::Option<&str>` - found enum `std::option::Option` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: expected enum `Option<&str>` + found enum `Option` error[E0308]: mismatched types - --> $DIR/wrong_param_type.rs:13:18 + --> $DIR/wrong_param_type.rs:13:50 | 13 | let _query = sqlx::query!("select $1::text", arg.as_ref()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found `i32` + | ^^^ expected `str`, found `i32` | - = note: expected enum `std::option::Option<&str>` - found enum `std::option::Option<&i32>` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: expected enum `Option<&str>` + found enum `Option<&i32>`