]> git.lizzy.rs Git - rust.git/blob - tests/source/where-clause-rfc.rs
Add a test for #2497
[rust.git] / tests / source / where-clause-rfc.rs
1 // rustfmt-indent_style: Block
2
3 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo, U: Bar {
4     let mut effects = HashMap::new();
5 }
6
7 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo {
8     let mut effects = HashMap::new();
9 }
10
11 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape, shape: &Shape) where T: FOo, U: Bar {
12     let mut effects = HashMap::new();
13 }
14
15 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape, shape: &Shape) where T: FOo {
16     let mut effects = HashMap::new();
17 }
18
19 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) -> Option<String> where T: FOo, U: Bar {
20     let mut effects = HashMap::new();
21 }
22
23 fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) -> Option<String> where T: FOo {
24     let mut effects = HashMap::new();
25 }
26
27 pub trait Test {
28     fn very_long_method_name<F>(self, f: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool;
29
30     fn exactly_100_chars1<F>(self, f: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool;
31 }
32
33 fn very_long_function_name<F>(very_long_argument: F) -> MyVeryLongReturnType where F: FnMut(Self::Item) -> bool { }
34
35 struct VeryLongTupleStructName<A, B, C, D, E>(LongLongTypename, LongLongTypename, i32, i32) where A: LongTrait;
36
37 struct Exactly100CharsToSemicolon<A, B, C, D, E>
38     (LongLongTypename, i32, i32)
39     where A: LongTrait1234;
40
41 struct AlwaysOnNextLine<LongLongTypename, LongTypename, A, B, C, D, E, F> where A: LongTrait {
42     x: i32
43 }
44
45 pub trait SomeTrait<T>
46     where
47     T: Something + Sync + Send + Display     + Debug     + Copy + Hash + Debug + Display + Write + Read + FromStr
48 {
49 }
50
51 // #2020
52 impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
53     fn elaborate_bounds<F>(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand: F)
54     where F: for<'b> FnMut(&mut ProbeContext<'b, 'gcx, 'tcx>, ty::PolyTraitRef<'tcx>, ty::AssociatedItem),
55     {
56         // ...
57     }
58 }
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 }