Skip to content

Commit c80974e

Browse files
committed
Post rebase fixes
1 parent fff78db commit c80974e

12 files changed

+91
-107
lines changed

diesel/src/insertable.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ where
290290
{
291291
type Values = BatchInsert<Vec<T::Values>, Tab, [T::Values; N], true>;
292292

293+
// We must use the deprecated `IntoIter` function
294+
// here as 1.51 (MSRV) does not support the new not
295+
// deprecated variant
296+
#[allow(deprecated)]
293297
fn values(self) -> Self::Values {
294298
let values = std::array::IntoIter::new(self)
295299
.map(Insertable::values)

diesel/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ pub mod helper_types {
386386
/// [`Iterator`](std::iter::Iterator) of [`QueryResult<U>`](crate::result::QueryResult)
387387
///
388388
/// See [`RunQueryDsl::load_iter`] for more information
389-
pub type LoadIter<'a, Q, Conn, U> = <Q as load_dsl::LoadQueryGatWorkaround<'a, Conn, U>>::Ret;
389+
pub type LoadIter<'conn, 'query, Q, Conn, U> =
390+
<Q as load_dsl::LoadQueryGatWorkaround<'conn, 'query, Conn, U>>::Ret;
390391
}
391392

392393
pub mod prelude {
@@ -450,3 +451,7 @@ pub use crate::result::Error::NotFound;
450451
pub(crate) mod diesel {
451452
pub use super::*;
452453
}
454+
455+
// workaround https://github.com/rust-lang/rust/pull/52234
456+
#[doc(hidden)]
457+
pub use __diesel_check_column_count_internal as __diesel_check_column_count;

diesel/src/query_dsl/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,10 +1507,13 @@ pub trait RunQueryDsl<Conn>: Sized {
15071507
/// # Ok(())
15081508
/// # }
15091509
/// ```
1510-
fn load_iter<'conn 'conn:'query, U>(self, conn: &'conn mut Conn) -> QueryResult<LoadIter<'conn, 'query, Self, Conn, U>>
1510+
fn load_iter<'conn, 'query: 'conn, U>(
1511+
self,
1512+
conn: &'conn mut Conn,
1513+
) -> QueryResult<LoadIter<'conn, 'query, Self, Conn, U>>
15111514
where
15121515
U: 'conn,
1513-
Self: LoadQuery<'qcory, Conn, U> + 'conn,
1516+
Self: LoadQuery<'query, Conn, U> + 'conn,
15141517
{
15151518
self.internal_load(conn)
15161519
}

diesel_compile_tests/tests/fail/array_expressions_must_be_same_type.stderr

Lines changed: 20 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ error[E0277]: the trait bound `{integer}: SelectableExpression<NoFromClause>` is
107107
|
108108
= help: the following implementations were found:
109109
<&'a T as SelectableExpression<QS>>
110-
<(A, B) as SelectableExpression<QS>>
111-
<(A, B, C) as SelectableExpression<QS>>
112-
<(A, B, C, D) as SelectableExpression<QS>>
110+
<(T0, T1) as SelectableExpression<QS>>
111+
<(T0, T1, T2) as SelectableExpression<QS>>
112+
<(T0, T1, T2, T3) as SelectableExpression<QS>>
113113
and 137 others
114114
= note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
115115
= note: 1 redundant requirements hidden
@@ -131,9 +131,9 @@ error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
131131
|
132132
= help: the following implementations were found:
133133
<&'a T as ValidGrouping<GB>>
134-
<(A, B) as ValidGrouping<__GroupByClause>>
135-
<(A, B, C) as ValidGrouping<__GroupByClause>>
136-
<(A, B, C, D) as ValidGrouping<__GroupByClause>>
134+
<(T0, T1) as ValidGrouping<__GroupByClause>>
135+
<(T0, T1, T2) as ValidGrouping<__GroupByClause>>
136+
<(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
137137
and 125 others
138138
= note: required because of the requirements on the impl of `ValidGrouping<()>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
139139
= note: 1 redundant requirements hidden
@@ -149,9 +149,9 @@ error[E0277]: the trait bound `{integer}: SelectableExpression<NoFromClause>` is
149149
|
150150
= help: the following implementations were found:
151151
<&'a T as SelectableExpression<QS>>
152-
<(A, B) as SelectableExpression<QS>>
153-
<(A, B, C) as SelectableExpression<QS>>
154-
<(A, B, C, D) as SelectableExpression<QS>>
152+
<(T0, T1) as SelectableExpression<QS>>
153+
<(T0, T1, T2) as SelectableExpression<QS>>
154+
<(T0, T1, T2, T3) as SelectableExpression<QS>>
155155
and 137 others
156156
= note: required because of the requirements on the impl of `SelectableExpression<NoFromClause>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
157157
= note: 1 redundant requirements hidden
@@ -168,9 +168,9 @@ error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
168168
|
169169
= help: the following implementations were found:
170170
<&'a T as ValidGrouping<GB>>
171-
<(A, B) as ValidGrouping<__GroupByClause>>
172-
<(A, B, C) as ValidGrouping<__GroupByClause>>
173-
<(A, B, C, D) as ValidGrouping<__GroupByClause>>
171+
<(T0, T1) as ValidGrouping<__GroupByClause>>
172+
<(T0, T1, T2) as ValidGrouping<__GroupByClause>>
173+
<(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
174174
and 125 others
175175
= note: required because of the requirements on the impl of `ValidGrouping<()>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
176176
= note: 1 redundant requirements hidden
@@ -187,8 +187,8 @@ error[E0277]: the trait bound `{integer}: QueryFragment<Pg>` is not satisfied
187187
= help: the following implementations were found:
188188
<&'a T as QueryFragment<DB>>
189189
<() as QueryFragment<DB>>
190-
<(A, B) as QueryFragment<__DB>>
191-
<(A, B, C) as QueryFragment<__DB>>
190+
<(T0, T1) as QueryFragment<__DB>>
191+
<(T0, T1, T2) as QueryFragment<__DB>>
192192
and 247 others
193193
= note: required because of the requirements on the impl of `QueryFragment<Pg>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
194194
= note: 3 redundant requirements hidden
@@ -204,33 +204,13 @@ error[E0277]: the trait bound `{integer}: QueryId` is not satisfied
204204
= help: the following implementations were found:
205205
<&'a T as QueryId>
206206
<() as QueryId>
207-
<(A, B) as QueryId>
208-
<(A, B, C) as QueryId>
207+
<(T0, T1) as QueryId>
208+
<(T0, T1, T2) as QueryId>
209209
and 212 others
210210
= note: required because of the requirements on the impl of `QueryId` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
211211
= note: 3 redundant requirements hidden
212212
= note: required because of the requirements on the impl of `QueryId` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
213-
= note: required because of the requirements on the impl of `LoadQuery<_, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
214-
215-
error[E0277]: the trait bound `{integer}: QueryFragment<Pg>` is not satisfied
216-
--> $DIR/array_expressions_must_be_same_type.rs:12:30
217-
|
218-
12 | select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
219-
| ^^^^^^^^^^ the trait `QueryFragment<Pg>` is not implemented for `{integer}`
220-
|
221-
= help: the following implementations were found:
222-
<&'a T as QueryFragment<DB>>
223-
<() as QueryFragment<DB>>
224-
<(A, B) as QueryFragment<__DB>>
225-
<(A, B, C) as QueryFragment<__DB>>
226-
and 242 others
227-
= note: required because of the requirements on the impl of `QueryFragment<Pg>` for `({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>)`
228-
= note: 2 redundant requirements hidden
229-
= note: required because of the requirements on the impl of `QueryFragment<Pg>` for `diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>`
230-
= note: required because of the requirements on the impl of `SelectClauseQueryFragment<NoFromClause, Pg>` for `diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>`
231-
= note: 1 redundant requirements hidden
232-
= note: required because of the requirements on the impl of `QueryFragment<Pg>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
233-
= note: required because of the requirements on the impl of `LoadQuery<_, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
213+
= note: required because of the requirements on the impl of `LoadQuery<'_, _, Vec<f64>>` for `SelectStatement<NoFromClause, diesel::query_builder::select_clause::SelectClause<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>>`
234214

235215
error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
236216
--> tests/fail/array_expressions_must_be_same_type.rs:12:12
@@ -245,27 +225,9 @@ error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
245225
|
246226
= help: the following implementations were found:
247227
<&'a T as diesel::Expression>
248-
<(A, B) as diesel::Expression>
249-
<(A, B, C) as diesel::Expression>
250-
<(A, B, C, D) as diesel::Expression>
228+
<(T0, T1) as diesel::Expression>
229+
<(T0, T1, T2) as diesel::Expression>
230+
<(T0, T1, T2, T3) as diesel::Expression>
251231
and 106 others
252232
= note: required because of the requirements on the impl of `AsExpression<diesel::sql_types::Double>` for `{integer}`
253233
= note: required because of the requirements on the impl of `AsExpressionList<diesel::sql_types::Double>` for `({integer}, f64)`
254-
255-
error[E0277]: the trait bound `SelectStatement<NoFromClause>: SelectDsl<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>` is not satisfied
256-
--> $DIR/array_expressions_must_be_same_type.rs:11:5
257-
|
258-
11 | select(array((1, 3f64))).get_result::<Vec<i32>>(&mut connection).unwrap();
259-
| ^^^^^^ the trait `SelectDsl<diesel::pg::expression::array::ArrayLiteral<(diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>, f64), diesel::sql_types::Integer>>` is not implemented for `SelectStatement<NoFromClause>`
260-
|
261-
= help: the following implementations were found:
262-
<SelectStatement<F, S, D, W, O, LOf, G, H, LC> as SelectDsl<Selection>>
263-
264-
error[E0277]: the trait bound `SelectStatement<NoFromClause>: SelectDsl<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>` is not satisfied
265-
--> $DIR/array_expressions_must_be_same_type.rs:12:5
266-
|
267-
12 | select(array((1, 3f64))).get_result::<Vec<f64>>(&mut connection).unwrap();
268-
| ^^^^^^ the trait `SelectDsl<diesel::pg::expression::array::ArrayLiteral<({integer}, diesel::expression::bound::Bound<diesel::sql_types::Double, f64>), diesel::sql_types::Double>>` is not implemented for `SelectStatement<NoFromClause>`
269-
|
270-
= help: the following implementations were found:
271-
<SelectStatement<F, S, D, W, O, LOf, G, H, LC> as SelectDsl<Selection>>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `users::table: AppearsInFromClause<posts::table>` is not satisfied
2-
--> $DIR/boxed_queries_require_selectable_expression_for_order.rs:21:37
2+
--> tests/fail/boxed_queries_require_selectable_expression_for_order.rs:21:37
33
|
44
21 | users::table.into_boxed::<Pg>().order(posts::title.desc());
55
| ^^^^^ the trait `AppearsInFromClause<posts::table>` is not implemented for `users::table`
@@ -9,5 +9,5 @@ error[E0277]: the trait bound `users::table: AppearsInFromClause<posts::table>`
99
= note: required because of the requirements on the impl of `AppearsInFromClause<posts::table>` for `FromClause<users::table>`
1010
= note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `posts::columns::title`
1111
= note: 1 redundant requirements hidden
12-
= note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `Desc<posts::columns::title>`
13-
= note: required because of the requirements on the impl of `OrderDsl<Desc<posts::columns::title>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
12+
= note: required because of the requirements on the impl of `AppearsOnTable<FromClause<users::table>>` for `diesel::expression::operators::Desc<posts::columns::title>`
13+
= note: required because of the requirements on the impl of `OrderDsl<diesel::expression::operators::Desc<posts::columns::title>>` for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>`
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
2-
--> $DIR/cannot_pass_aggregate_to_where.rs:15:24
2+
--> tests/fail/cannot_pass_aggregate_to_where.rs:15:24
33
|
44
15 | let source = users.filter(count(id).gt(3));
55
| ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
66
|
77
= help: the following implementations were found:
88
<diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
99
<diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
10-
= note: required because of the requirements on the impl of `FilterDsl<Grouped<Gt<count::count::count<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<BigInt, i64>>>>` for `SelectStatement<FromClause<users::table>>`
10+
= note: required because of the requirements on the impl of `NonAggregate` for `Grouped<diesel::expression::operators::Gt<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<BigInt, i64>>>`
11+
= note: required because of the requirements on the impl of `FilterDsl<Grouped<diesel::expression::operators::Gt<diesel::expression::count::count::count<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<BigInt, i64>>>>` for `SelectStatement<FromClause<users::table>>`
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
error[E0277]: the trait bound `diesel::sql_types::Text: BoolOrNullableBool` is not satisfied
2-
--> $DIR/filter_requires_bool_nonaggregate_expression.rs:15:26
2+
--> tests/fail/filter_requires_bool_nonaggregate_expression.rs:15:26
33
|
44
15 | let _ = users::table.filter(users::name);
55
| ^^^^^^ the trait `BoolOrNullableBool` is not implemented for `diesel::sql_types::Text`
66
|
77
= note: required because of the requirements on the impl of `FilterDsl<columns::name>` for `SelectStatement<FromClause<users::table>>`
88

99
error[E0277]: the trait bound `diesel::expression::is_aggregate::Yes: MixedAggregates<diesel::expression::is_aggregate::No>` is not satisfied
10-
--> $DIR/filter_requires_bool_nonaggregate_expression.rs:16:26
10+
--> tests/fail/filter_requires_bool_nonaggregate_expression.rs:16:26
1111
|
1212
16 | let _ = users::table.filter(sum(users::id).eq(1));
1313
| ^^^^^^ the trait `MixedAggregates<diesel::expression::is_aggregate::No>` is not implemented for `diesel::expression::is_aggregate::Yes`
1414
|
1515
= help: the following implementations were found:
1616
<diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Never>>
1717
<diesel::expression::is_aggregate::Yes as MixedAggregates<diesel::expression::is_aggregate::Yes>>
18+
= note: required because of the requirements on the impl of `NonAggregate` for `Grouped<diesel::expression::operators::Eq<aggregate_folding::sum::sum<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<diesel::sql_types::Nullable<BigInt>, i64>>>`
1819
= note: required because of the requirements on the impl of `FilterDsl<Grouped<diesel::expression::operators::Eq<aggregate_folding::sum::sum<diesel::sql_types::Integer, columns::id>, diesel::expression::bound::Bound<diesel::sql_types::Nullable<BigInt>, i64>>>>` for `SelectStatement<FromClause<users::table>>`

diesel_compile_tests/tests/fail/find_requires_correct_type.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ error[E0277]: the trait bound `str: diesel::Expression` is not satisfied
1010
= note: required because of the requirements on the impl of `FilterDsl<Grouped<diesel::expression::operators::Eq<int_primary_key::columns::id, &str>>>` for `SelectStatement<FromClause<int_primary_key::table>>`
1111

1212
error[E0277]: the trait bound `str: ValidGrouping<()>` is not satisfied
13-
--> $DIR/find_requires_correct_type.rs:20:33
13+
--> tests/fail/find_requires_correct_type.rs:20:33
1414
|
1515
20 | int_primary_key::table.find("1");
1616
| ^^^ the trait `ValidGrouping<()>` is not implemented for `str`
1717
|
1818
= note: required because of the requirements on the impl of `ValidGrouping<()>` for `&str`
1919
= note: 1 redundant requirements hidden
2020
= note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::expression::operators::Eq<int_primary_key::columns::id, &str>`
21+
= note: required because of the requirements on the impl of `NonAggregate` for `Grouped<diesel::expression::operators::Eq<int_primary_key::columns::id, &str>>`
2122
= note: required because of the requirements on the impl of `FilterDsl<Grouped<diesel::expression::operators::Eq<int_primary_key::columns::id, &str>>>` for `SelectStatement<FromClause<int_primary_key::table>>`
2223

2324
error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
24-
--> $DIR/find_requires_correct_type.rs:22:36
25+
--> tests/fail/find_requires_correct_type.rs:22:36
2526
|
2627
22 | string_primary_key::table.find(1);
2728
| ^ the trait `diesel::Expression` is not implemented for `{integer}`
@@ -36,7 +37,7 @@ error[E0277]: the trait bound `{integer}: diesel::Expression` is not satisfied
3637
= note: required because of the requirements on the impl of `FilterDsl<Grouped<diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>>>` for `SelectStatement<FromClause<string_primary_key::table>>`
3738

3839
error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
39-
--> $DIR/find_requires_correct_type.rs:22:36
40+
--> tests/fail/find_requires_correct_type.rs:22:36
4041
|
4142
22 | string_primary_key::table.find(1);
4243
| ^ the trait `ValidGrouping<()>` is not implemented for `{integer}`
@@ -48,4 +49,5 @@ error[E0277]: the trait bound `{integer}: ValidGrouping<()>` is not satisfied
4849
<(T0, T1, T2, T3) as ValidGrouping<__GroupByClause>>
4950
and 131 others
5051
= note: required because of the requirements on the impl of `ValidGrouping<()>` for `diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>`
52+
= note: required because of the requirements on the impl of `NonAggregate` for `Grouped<diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>>`
5153
= note: required because of the requirements on the impl of `FilterDsl<Grouped<diesel::expression::operators::Eq<string_primary_key::columns::id, {integer}>>>` for `SelectStatement<FromClause<string_primary_key::table>>`

0 commit comments

Comments
 (0)