Skip to content

Commit

Permalink
Compile test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Jan 2, 2023
1 parent b5568a5 commit 8a9c304
Show file tree
Hide file tree
Showing 18 changed files with 173 additions and 232 deletions.
2 changes: 1 addition & 1 deletion diesel/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub(crate) use self::private::{DieselReserveSpecialization, TrustedBackend};
/// * Specify how a query should be build from string parts by providing a [`QueryBuilder`]
/// matching your backend
/// * Specify the bind value format used by your database connection library by providing
/// a [`BindCollector`] matching your backend
/// a [`BindCollector`](crate::query_builder::bind_collector::BindCollector) matching your backend
/// * Specify how values are receive from the database by providing a corresponding raw value
/// definition
/// * Control sql dialect specific parts of diesels query dsl implementation by providing a
Expand Down
28 changes: 10 additions & 18 deletions diesel_compile_tests/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion diesel_compile_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"

[dependencies]
diesel = { version = "2.0.0", default-features = false, features = ["extras", "sqlite", "postgres", "mysql", "with-deprecated", "nightly-error-messages"], path = "../diesel" }
trybuild = "1.0.41"
trybuild = "1.0.73"

[workspace]
2 changes: 0 additions & 2 deletions diesel_compile_tests/tests/fail/derive/aliases.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ error[E0277]: Cannot select `users::columns::id` from `Alias<users2>`
<users::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
<users::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
<users::columns::id as SelectableExpression<users::table>>
= note: required for `diesel::query_builder::select_clause::SelectClause<users::columns::id>` to implement `diesel::query_builder::select_clause::SelectClauseExpression<FromClause<Alias<users2>>>`
= note: required for `SelectStatement<FromClause<Alias<users2>>, diesel::query_builder::select_clause::SelectClause<users::columns::id>>` to implement `SelectQuery`
= note: required for `SelectStatement<FromClause<Alias<users2>>>` to implement `SelectDsl<users::columns::id>`
= note: 1 redundant requirement hidden
= note: required for `Alias<users2>` to implement `SelectDsl<users::columns::id>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ error: expected identifier
78 | #[belongs_to(parent = "1")]
| ^^^

warning: #[belongs_to] attribute form is deprecated
= help: use `#[diesel(belongs_to(Bar))]` instead

error: expected `foreign_key`
--> tests/fail/derive_deprecated/deprecated_belongs_to.rs:92:19
|
Expand All @@ -79,9 +76,6 @@ error: expected identifier
113 | #[belongs_to(Bar, foreign_key = "1")]
| ^^^

warning: #[belongs_to] attribute form is deprecated
= help: use `#[diesel(belongs_to(Baz, foreign_key = bar_id))]` instead

error: unexpected expression: `Bar`
--> tests/fail/derive_deprecated/deprecated_belongs_to.rs:36:16
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
warning: #[changeset_options] attribute form is deprecated
= help: use `#[diesel(treat_none_as_null = true)]` instead

error: unexpected end of input, expected parentheses
--> tests/fail/derive_deprecated/deprecated_changeset_options.rs:21:3
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
warning: #[column_name] attribute form is deprecated
= help: use `#[diesel(column_name = name)]` instead

warning: #[column_name] attribute form is deprecated
= help: use `#[diesel(column_name = name)]` instead

error: unexpected end of input, expected `=`
--> tests/fail/derive_deprecated/deprecated_column_name.rs:24:7
|
Expand All @@ -24,9 +18,6 @@ error: expected string literal
38 | #[column_name = 1]
| ^

warning: #[column_name] attribute form is deprecated
= help: use `#[diesel(column_name = 1)]` instead

error: expected string literal
--> tests/fail/derive_deprecated/deprecated_column_name.rs:45:21
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ error: expected string literal
14 | #[mysql_type = 1]
| ^

warning: #[mysql_type] attribute form is deprecated
= help: use `#[diesel(mysql_type(name = "foo"))]` instead

error[E0599]: no variant or associated item named `foo` found for enum `MysqlType` in the current scope
--> tests/fail/derive_deprecated/deprecated_mysql_type.rs:17:10
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ error: expected string literal
46 | #[postgres(oid = "1", array_oid = 1)]
| ^

warning: #[postgres] attribute form is deprecated
= help: use `#[diesel(postgres_type(oid = 1, array_oid = 1))]` instead

error: unknown attribute, expected one of `oid`, `array_oid`, `type_name`
--> tests/fail/derive_deprecated/deprecated_postgres_type.rs:54:12
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ error: expected parentheses
33 | #[primary_key = id]
| ^

warning: #[primary_key] attribute form is deprecated
= help: use `#[diesel(primary_key(id, name))]` instead

error: Deriving `AsChangeset` on a structure that only contains primary keys isn't supported.
--> tests/fail/derive_deprecated/deprecated_primary_key.rs:39:10
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
warning: #[sql_type] attribute form is deprecated
= help: use `#[diesel(sql_type = foo)]` instead

error: unexpected end of input, expected `=`
--> tests/fail/derive_deprecated/deprecated_sql_type.rs:10:3
|
Expand All @@ -21,18 +18,12 @@ error: expected string literal
18 | #[sql_type = 1]
| ^

warning: #[sql_type] attribute form is deprecated
= help: use `#[diesel(sql_type = 1)]` instead

error: expected identifier
--> tests/fail/derive_deprecated/deprecated_sql_type.rs:22:14
|
22 | #[sql_type = "1"]
| ^^^

warning: #[sql_type] attribute form is deprecated
= help: use `#[diesel(sql_type = foo)]` instead

error: unexpected end of input, expected `=`
--> tests/fail/derive_deprecated/deprecated_sql_type.rs:33:7
|
Expand All @@ -53,9 +44,6 @@ error: expected string literal
45 | #[sql_type = 1]
| ^

warning: #[sql_type] attribute form is deprecated
= help: use `#[diesel(sql_type = 1)]` instead

error: expected identifier
--> tests/fail/derive_deprecated/deprecated_sql_type.rs:51:18
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ error: expected string literal
14 | #[sqlite_type = 1]
| ^

warning: #[sqlite_type] attribute form is deprecated
= help: use `#[diesel(sqlite_type(name = "foo"))]` instead

error[E0599]: no variant or associated item named `foo` found for enum `SqliteType` in the current scope
--> tests/fail/derive_deprecated/deprecated_sqlite_type.rs:17:10
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
warning: #[table_name] attribute form is deprecated
= help: use `#[diesel(table_name = users)]` instead

error: unexpected end of input, expected `=`
--> tests/fail/derive_deprecated/deprecated_table_name.rs:12:3
|
Expand All @@ -21,9 +18,6 @@ error: expected string literal
25 | #[table_name = 1]
| ^

warning: #[table_name] attribute form is deprecated
= help: use `#[diesel(table_name = 1)]` instead

error: expected identifier
--> tests/fail/derive_deprecated/deprecated_table_name.rs:32:16
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
error[E0277]: Cannot select `posts::columns::id` from `users::table`
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:23:30
|
23 | users::table.distinct_on(posts::id).get_results(&mut connection);
| ----------- ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
| |
| required by a bound introduced by this call
|
= note: `posts::columns::id` is no valid selection for `users::table`
= help: the following other types implement trait `SelectableExpression<QS>`:
<posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
<posts::columns::id as SelectableExpression<Only<posts::table>>>
<posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
<posts::columns::id as SelectableExpression<posts::table>>
<posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
<posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
= note: required for `users::table` to implement `DistinctOnDsl<posts::columns::id>`
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:23:30
|
23 | users::table.distinct_on(posts::id).get_results(&mut connection);
| ----------- ^^^^^^^^^ the trait `SelectableExpression<users::table>` is not implemented for `posts::columns::id`
| |
| required by a bound introduced by this call
|
= note: `posts::columns::id` is no valid selection for `users::table`
= help: the following other types implement trait `SelectableExpression<QS>`:
<posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
<posts::columns::id as SelectableExpression<Only<posts::table>>>
<posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
<posts::columns::id as SelectableExpression<posts::table>>
<posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, Inner>>>
<posts::columns::id as SelectableExpression<query_source::joins::Join<Left, Right, LeftOuter>>>
= note: required for `users::table` to implement `DistinctOnDsl<posts::columns::id>`
note: required by a bound in `diesel::QueryDsl::distinct_on`
--> $DIESEL/src/query_dsl/mod.rs
|
| Self: methods::DistinctOnDsl<Expr>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::QueryDsl::distinct_on`
--> $DIESEL/src/query_dsl/mod.rs
|
| Self: methods::DistinctOnDsl<Expr>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::QueryDsl::distinct_on`

error[E0277]: the trait bound `(diesel::sql_types::Text, diesel::sql_types::Text): SingleValue` is not satisfied
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:25:30
|
25 | posts::table.distinct_on((posts::name, users::name)).get_result(&mut connection);
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Text, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Datetime
Inet
Interval
and 23 others
= note: required for `SelectStatement<FromClause<posts::table>>` to implement `DistinctOnDsl<(posts::columns::name, users::columns::name)>`
= note: 1 redundant requirement hidden
= note: required for `posts::table` to implement `DistinctOnDsl<(posts::columns::name, users::columns::name)>`
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:25:30
|
25 | posts::table.distinct_on((posts::name, users::name)).get_result(&mut connection);
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Text, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Datetime
Inet
Interval
and $N others
= note: required for `SelectStatement<FromClause<posts::table>>` to implement `DistinctOnDsl<(posts::columns::name, users::columns::name)>`
= note: 1 redundant requirement hidden
= note: required for `posts::table` to implement `DistinctOnDsl<(posts::columns::name, users::columns::name)>`
note: required by a bound in `diesel::QueryDsl::distinct_on`
--> $DIESEL/src/query_dsl/mod.rs
|
| Self: methods::DistinctOnDsl<Expr>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::QueryDsl::distinct_on`
--> $DIESEL/src/query_dsl/mod.rs
|
| Self: methods::DistinctOnDsl<Expr>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::QueryDsl::distinct_on`

error[E0277]: Cannot select `users::columns::name` from `posts::table`
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:25:18
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
error[E0277]: the trait bound `diesel::sql_types::Text: BoolOrNullableBool` is not satisfied
--> tests/fail/filter_requires_bool_nonaggregate_expression.rs:15:33
|
15 | let _ = users::table.filter(users::name);
| ------ ^^^^^^^^^^^ the trait `BoolOrNullableBool` is not implemented for `diesel::sql_types::Text`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `BoolOrNullableBool`:
Bool
Nullable<Bool>
= note: required for `SelectStatement<FromClause<users::table>>` to implement `FilterDsl<columns::name>`
= note: 1 redundant requirement hidden
= note: required for `users::table` to implement `FilterDsl<columns::name>`
--> tests/fail/filter_requires_bool_nonaggregate_expression.rs:15:33
|
15 | let _ = users::table.filter(users::name);
| ------ ^^^^^^^^^^^ the trait `BoolOrNullableBool` is not implemented for `diesel::sql_types::Text`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `BoolOrNullableBool`:
Bool
Nullable<Bool>
= note: required for `diesel::query_builder::where_clause::NoWhereClause` to implement `diesel::query_builder::where_clause::WhereAnd<columns::name>`
= note: required for `SelectStatement<FromClause<users::table>>` to implement `FilterDsl<columns::name>`
= note: 1 redundant requirement hidden
= note: required for `users::table` to implement `FilterDsl<columns::name>`
note: required by a bound in `diesel::QueryDsl::filter`
--> $DIESEL/src/query_dsl/mod.rs
|
| Self: methods::FilterDsl<Predicate>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::QueryDsl::filter`
--> $DIESEL/src/query_dsl/mod.rs
|
| Self: methods::FilterDsl<Predicate>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `diesel::QueryDsl::filter`

error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
--> tests/fail/filter_requires_bool_nonaggregate_expression.rs:16:26
Expand Down
Loading

0 comments on commit 8a9c304

Please sign in to comment.