Skip to content

Commit

Permalink
Update compile tests to expect tablesample in stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Vogel committed Feb 10, 2024
1 parent 8cf733d commit cc27cd9
Show file tree
Hide file tree
Showing 27 changed files with 199 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ error[E0277]: Cannot select `posts::columns::id` from `users::table`
<posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
<posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
<posts::columns::id as SelectableExpression<Only<posts::table>>>
<posts::columns::id as SelectableExpression<Tablesample<posts::table, TSM>>>
= note: required for `diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>` to implement `SelectableExpression<users::table>`
= note: required for `SelectStatement<FromClause<users::table>>` to implement `SelectDsl<diesel::expression::functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, posts::columns::id>>`

Expand Down Expand Up @@ -40,10 +41,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<posts::table>`
note: required for `posts::columns::id` to implement `AppearsOnTable<users::table>`
--> tests/fail/aggregate_expression_requires_column_from_same_table.rs:14:9
Expand All @@ -69,6 +73,7 @@ error[E0277]: Cannot select `posts::columns::id` from `users::table`
<posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
<posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
<posts::columns::id as SelectableExpression<Only<posts::table>>>
<posts::columns::id as SelectableExpression<Tablesample<posts::table, TSM>>>
= note: required for `diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>` to implement `SelectableExpression<users::table>`
= note: required for `SelectStatement<FromClause<users::table>>` to implement `SelectDsl<diesel::expression::functions::aggregate_folding::avg::avg<diesel::sql_types::Integer, posts::columns::id>>`

Expand Down Expand Up @@ -97,10 +102,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<posts::table>`
note: required for `posts::columns::id` to implement `AppearsOnTable<users::table>`
--> tests/fail/aggregate_expression_requires_column_from_same_table.rs:14:9
Expand All @@ -126,6 +134,7 @@ error[E0277]: Cannot select `posts::columns::id` from `users::table`
<posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
<posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
<posts::columns::id as SelectableExpression<Only<posts::table>>>
<posts::columns::id as SelectableExpression<Tablesample<posts::table, TSM>>>
= note: required for `diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>` to implement `SelectableExpression<users::table>`
= note: required for `SelectStatement<FromClause<users::table>>` to implement `SelectDsl<diesel::expression::functions::aggregate_ordering::max::max<diesel::sql_types::Integer, posts::columns::id>>`

Expand Down Expand Up @@ -154,10 +163,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<posts::table>`
note: required for `posts::columns::id` to implement `AppearsOnTable<users::table>`
--> tests/fail/aggregate_expression_requires_column_from_same_table.rs:14:9
Expand All @@ -183,6 +195,7 @@ error[E0277]: Cannot select `posts::columns::id` from `users::table`
<posts::columns::id as SelectableExpression<SelectStatement<FromClause<From>>>>
<posts::columns::id as SelectableExpression<JoinOn<Join, On>>>
<posts::columns::id as SelectableExpression<Only<posts::table>>>
<posts::columns::id as SelectableExpression<Tablesample<posts::table, TSM>>>
= note: required for `diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>` to implement `SelectableExpression<users::table>`
= note: required for `SelectStatement<FromClause<users::table>>` to implement `SelectDsl<diesel::expression::functions::aggregate_ordering::min::min<diesel::sql_types::Integer, posts::columns::id>>`

Expand Down Expand Up @@ -211,10 +224,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<posts::table>`
note: required for `posts::columns::id` to implement `AppearsOnTable<users::table>`
--> tests/fail/aggregate_expression_requires_column_from_same_table.rs:14:9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ error[E0277]: the trait bound `stuff::table: TableNotEqual<more_stuff::table>` i
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `stuff::table` to implement `AppearsInFromClause<more_stuff::table>`
note: required for `more_stuff::columns::names` to implement `AppearsOnTable<stuff::table>`
--> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:15:9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ error[E0277]: the trait bound `BoxedSelectStatement<'_, diesel::sql_types::Text,
posts::table
users::table
Only<S>
Tablesample<S, TSM>
pg::metadata_lookup::pg_namespace::table
pg::metadata_lookup::pg_type::table
= note: required for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::name>` to implement `JoinTo<query_source::joins::OnClauseWrapper<_, _>>`
Expand Down Expand Up @@ -128,6 +129,7 @@ error[E0277]: the trait bound `BoxedSelectStatement<'_, (diesel::sql_types::Inte
posts::table
users::table
Only<S>
Tablesample<S, TSM>
pg::metadata_lookup::pg_namespace::table
pg::metadata_lookup::pg_type::table
= note: required for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, _>` to implement `GroupByDsl<_>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<posts::table>`
note: required for `posts::columns::title` to implement `AppearsOnTable<users::table>`
--> tests/fail/boxed_queries_require_selectable_expression_for_filter.rs:16:9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<posts::table>` is not
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<posts::table>`
note: required for `posts::columns::title` to implement `AppearsOnTable<users::table>`
--> tests/fail/boxed_queries_require_selectable_expression_for_order.rs:16:9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ error[E0277]: the trait bound `users::table: JoinTo<posts::table>` is not satisf
<users::table as JoinTo<Alias<S>>>
<users::table as JoinTo<JoinOn<Join, On>>>
<users::table as JoinTo<Only<S>>>
<users::table as JoinTo<Tablesample<S, TSM>>>
= note: required for `users::table` to implement `JoinWithImplicitOnClause<posts::table, Inner>`
note: required by a bound in `inner_join`
--> $DIESEL/src/query_dsl/mod.rs
Expand All @@ -38,6 +39,7 @@ error[E0277]: the trait bound `users::table: JoinTo<posts::table>` is not satisf
<users::table as JoinTo<Alias<S>>>
<users::table as JoinTo<JoinOn<Join, On>>>
<users::table as JoinTo<Only<S>>>
<users::table as JoinTo<Tablesample<S, TSM>>>
= note: required for `users::table` to implement `JoinWithImplicitOnClause<posts::table, LeftOuter>`
note: required by a bound in `left_outer_join`
--> $DIESEL/src/query_dsl/mod.rs
Expand All @@ -62,5 +64,6 @@ error[E0277]: the trait bound `posts::table: JoinTo<users::table>` is not satisf
<posts::table as JoinTo<Alias<S>>>
<posts::table as JoinTo<JoinOn<Join, On>>>
<posts::table as JoinTo<Only<S>>>
<posts::table as JoinTo<Tablesample<S, TSM>>>
= note: required for `query_source::joins::Join<posts::table, comments::table, Inner>` to implement `JoinTo<users::table>`
= note: required for `users::table` to implement `JoinWithImplicitOnClause<SelectStatement<FromClause<JoinOn<query_source::joins::Join<posts::table, comments::table, Inner>, diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<NullableExpression<comments::columns::post_id>, NullableExpression<posts::columns::id>>>>>>, Inner>`
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ error[E0277]: Cannot select `bad::columns::age` from `users::table`
<bad::columns::age as SelectableExpression<SelectStatement<FromClause<From>>>>
<bad::columns::age as SelectableExpression<JoinOn<Join, On>>>
<bad::columns::age as SelectableExpression<Only<bad::table>>>
<bad::columns::age as SelectableExpression<Tablesample<bad::table, TSM>>>
= note: required for `UpdateStatement<table, WhereClause<Grouped<Eq<id, Bound<Integer, i32>>>>, Assign<..., ...>, ...>` to implement `Query`
note: required by a bound in `UpdateStatement::<T, U, V>::returning`
--> $DIESEL/src/query_builder/update_statement/mod.rs
Expand All @@ -40,6 +41,7 @@ error[E0277]: Cannot select `bad::columns::age` from `users::table`
<bad::columns::age as SelectableExpression<SelectStatement<FromClause<From>>>>
<bad::columns::age as SelectableExpression<JoinOn<Join, On>>>
<bad::columns::age as SelectableExpression<Only<bad::table>>>
<bad::columns::age as SelectableExpression<Tablesample<bad::table, TSM>>>
= note: required for `(users::columns::name, bad::columns::age)` to implement `SelectableExpression<users::table>`
= note: required for `InsertStatement<table, ValuesClause<(DefaultableColumnInsertValue<...>,), ...>, ..., ...>` to implement `Query`
note: required by a bound in `InsertStatement::<T, U, Op>::returning`
Expand Down Expand Up @@ -88,10 +90,13 @@ error[E0277]: the trait bound `users::table: TableNotEqual<bad::table>` is not s
= help: the following other types implement trait `TableNotEqual<T>`:
<Only<pg::metadata_lookup::pg_namespace::table> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Only<pg::metadata_lookup::pg_type::table> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<Tablesample<pg::metadata_lookup::pg_namespace::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<Tablesample<pg::metadata_lookup::pg_type::table, TSM> as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Only<pg::metadata_lookup::pg_type::table>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<Tablesample<pg::metadata_lookup::pg_type::table, TSM>>>
<pg::metadata_lookup::pg_namespace::table as TableNotEqual<pg::metadata_lookup::pg_type::table>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<Only<pg::metadata_lookup::pg_namespace::table>>>
<pg::metadata_lookup::pg_type::table as TableNotEqual<pg::metadata_lookup::pg_namespace::table>>
and $N others
= note: required for `users::table` to implement `AppearsInFromClause<bad::table>`
note: required for `bad::columns::age` to implement `AppearsOnTable<users::table>`
--> tests/fail/custom_returning_requires_selectable_expression.rs:16:7
Expand Down
Loading

0 comments on commit cc27cd9

Please sign in to comment.