Skip to content

Commit ccd134e

Browse files
committed
Add a test for #2497
Closes #2497.
1 parent 7917d6f commit ccd134e

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

src/items.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,10 +921,6 @@ pub fn format_trait(context: &RewriteContext, item: &ast::Item, offset: Indent)
921921
}
922922
}
923923
if !type_param_bounds.is_empty() {
924-
let shape = Shape {
925-
indent: shape.indent.block_unindent(context.config),
926-
..shape
927-
};
928924
result = rewrite_assign_rhs_with(
929925
context,
930926
result + ":",

tests/source/where-clause-rfc.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,20 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
5656
// ...
5757
}
5858
}
59+
60+
// #2497
61+
fn handle_update<'a, Tab, Conn, R, C>(executor: &Executor<PooledConnection<ConnectionManager<Conn>>>, change_set: &'a C) -> ExecutionResult
62+
where &'a C: Identifiable + AsChangeset<Target = Tab> + HasTable<Table = Tab>,
63+
<&'a C as AsChangeset>::Changeset: QueryFragment<Conn::Backend>,
64+
Tab: Table + HasTable<Table = Tab>,
65+
Tab::PrimaryKey: EqAll<<&'a C as Identifiable>::Id>,
66+
Tab::FromClause: QueryFragment<Conn::Backend>,
67+
Tab: FindDsl<<&'a C as Identifiable>::Id>,
68+
Find<Tab, <&'a C as Identifiable>::Id>: IntoUpdateTarget<Table = Tab>,
69+
<Find<Tab, <&'a C as Identifiable>::Id> as IntoUpdateTarget>::WhereClause: QueryFragment<Conn::Backend>,
70+
Tab::Query: FilterDsl<<Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>,
71+
Filter<Tab::Query, <Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>: LimitDsl,
72+
Limit<Filter<Tab::Query, <Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>>: QueryDsl + BoxedDsl< 'a, Conn::Backend, Output = BoxedSelectStatement<'a, R::SqlType, Tab, Conn::Backend>>,
73+
R: LoadingHandler<Conn, Table = Tab, SqlType = Tab::SqlType> + GraphQLType<TypeInfo = (), Context = ()>, {
74+
unimplemented!()
75+
}

tests/target/where-clause-rfc.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,33 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
126126
// ...
127127
}
128128
}
129+
130+
// #2497
131+
fn handle_update<'a, Tab, Conn, R, C>(
132+
executor: &Executor<PooledConnection<ConnectionManager<Conn>>>,
133+
change_set: &'a C,
134+
) -> ExecutionResult
135+
where
136+
&'a C: Identifiable + AsChangeset<Target = Tab> + HasTable<Table = Tab>,
137+
<&'a C as AsChangeset>::Changeset: QueryFragment<Conn::Backend>,
138+
Tab: Table + HasTable<Table = Tab>,
139+
Tab::PrimaryKey: EqAll<<&'a C as Identifiable>::Id>,
140+
Tab::FromClause: QueryFragment<Conn::Backend>,
141+
Tab: FindDsl<<&'a C as Identifiable>::Id>,
142+
Find<Tab, <&'a C as Identifiable>::Id>: IntoUpdateTarget<Table = Tab>,
143+
<Find<Tab, <&'a C as Identifiable>::Id> as IntoUpdateTarget>::WhereClause:
144+
QueryFragment<Conn::Backend>,
145+
Tab::Query: FilterDsl<<Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>,
146+
Filter<Tab::Query, <Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>: LimitDsl,
147+
Limit<Filter<Tab::Query, <Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>>:
148+
QueryDsl
149+
+ BoxedDsl<
150+
'a,
151+
Conn::Backend,
152+
Output = BoxedSelectStatement<'a, R::SqlType, Tab, Conn::Backend>,
153+
>,
154+
R: LoadingHandler<Conn, Table = Tab, SqlType = Tab::SqlType>
155+
+ GraphQLType<TypeInfo = (), Context = ()>,
156+
{
157+
unimplemented!()
158+
}

0 commit comments

Comments
 (0)