]> git.lizzy.rs Git - rust.git/commitdiff
Add a test for #2497
authorSeiichi Uchida <seuchida@gmail.com>
Sat, 10 Mar 2018 06:11:49 +0000 (15:11 +0900)
committertopecongiro <seuchida@gmail.com>
Sun, 11 Mar 2018 22:54:12 +0000 (07:54 +0900)
Closes #2497.

src/items.rs
tests/source/where-clause-rfc.rs
tests/target/where-clause-rfc.rs

index 1d02ba653ce62092187423569b3c3e94049d4996..b639697194b7a5f68ca04e669602d2bb1cffcb90 100644 (file)
@@ -921,10 +921,6 @@ pub fn format_trait(context: &RewriteContext, item: &ast::Item, offset: Indent)
             }
         }
         if !type_param_bounds.is_empty() {
-            let shape = Shape {
-                indent: shape.indent.block_unindent(context.config),
-                ..shape
-            };
             result = rewrite_assign_rhs_with(
                 context,
                 result + ":",
index e41e9a6cea1c600499d0ea7970718a206d0ef6a1..d915fccf1a0f1cb370d8950533cdd548b2b7c4ed 100644 (file)
@@ -56,3 +56,20 @@ fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand
         // ...
     }
 }
+
+// #2497
+fn handle_update<'a, Tab, Conn, R, C>(executor: &Executor<PooledConnection<ConnectionManager<Conn>>>, change_set: &'a C) -> ExecutionResult
+where &'a C: Identifiable + AsChangeset<Target = Tab> + HasTable<Table = Tab>,
+      <&'a C as AsChangeset>::Changeset: QueryFragment<Conn::Backend>,
+      Tab: Table + HasTable<Table = Tab>,
+      Tab::PrimaryKey: EqAll<<&'a C as Identifiable>::Id>,
+      Tab::FromClause: QueryFragment<Conn::Backend>,
+      Tab: FindDsl<<&'a C as Identifiable>::Id>,
+      Find<Tab, <&'a C as Identifiable>::Id>: IntoUpdateTarget<Table = Tab>,
+      <Find<Tab, <&'a C as Identifiable>::Id> as IntoUpdateTarget>::WhereClause: QueryFragment<Conn::Backend>,
+      Tab::Query: FilterDsl<<Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>,
+      Filter<Tab::Query, <Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>: LimitDsl,
+      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>>,
+      R: LoadingHandler<Conn, Table = Tab, SqlType = Tab::SqlType> + GraphQLType<TypeInfo = (), Context = ()>, {
+    unimplemented!()
+}
index 1e83d5b3abc406f07c89a5693273ba5fd55980b6..a41d82c8e4179da431c8606a7dcb878e87c3ed1f 100644 (file)
@@ -126,3 +126,33 @@ fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand
         // ...
     }
 }
+
+// #2497
+fn handle_update<'a, Tab, Conn, R, C>(
+    executor: &Executor<PooledConnection<ConnectionManager<Conn>>>,
+    change_set: &'a C,
+) -> ExecutionResult
+where
+    &'a C: Identifiable + AsChangeset<Target = Tab> + HasTable<Table = Tab>,
+    <&'a C as AsChangeset>::Changeset: QueryFragment<Conn::Backend>,
+    Tab: Table + HasTable<Table = Tab>,
+    Tab::PrimaryKey: EqAll<<&'a C as Identifiable>::Id>,
+    Tab::FromClause: QueryFragment<Conn::Backend>,
+    Tab: FindDsl<<&'a C as Identifiable>::Id>,
+    Find<Tab, <&'a C as Identifiable>::Id>: IntoUpdateTarget<Table = Tab>,
+    <Find<Tab, <&'a C as Identifiable>::Id> as IntoUpdateTarget>::WhereClause:
+        QueryFragment<Conn::Backend>,
+    Tab::Query: FilterDsl<<Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>,
+    Filter<Tab::Query, <Tab::PrimaryKey as EqAll<<&'a C as Identifiable>::Id>>::Output>: LimitDsl,
+    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>,
+            >,
+    R: LoadingHandler<Conn, Table = Tab, SqlType = Tab::SqlType>
+        + GraphQLType<TypeInfo = (), Context = ()>,
+{
+    unimplemented!()
+}