]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/issue-4689/one.rs
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
[rust.git] / src / tools / rustfmt / tests / target / issue-4689 / one.rs
1 // rustfmt-version: One
2
3 // Based on the issue description
4 pub trait PrettyPrinter<'tcx>:
5     Printer<
6     'tcx,
7     Error = fmt::Error,
8     Path = Self,
9     Region = Self,
10     Type = Self,
11     DynExistential = Self,
12     Const = Self,
13 >
14 {
15     //
16 }
17 pub trait PrettyPrinter<'tcx>:
18     Printer<
19         'tcx,
20         Error = fmt::Error,
21         Path = Self,
22         Region = Self,
23         Type = Self,
24         DynExistential = Self,
25         Const = Self,
26     > + fmt::Write
27 {
28     //
29 }
30 pub trait PrettyPrinter<'tcx>:
31     Printer<
32         'tcx,
33         Error = fmt::Error,
34         Path = Self,
35         Region = Self,
36         Type = Self,
37         DynExistential = Self,
38         Const = Self,
39     > + fmt::Write1
40     + fmt::Write2
41 {
42     //
43 }
44 pub trait PrettyPrinter<'tcx>:
45     fmt::Write
46     + Printer<
47         'tcx,
48         Error = fmt::Error,
49         Path = Self,
50         Region = Self,
51         Type = Self,
52         DynExistential = Self,
53         Const = Self,
54     >
55 {
56     //
57 }
58 pub trait PrettyPrinter<'tcx>:
59     fmt::Write
60     + Printer1<
61         'tcx,
62         Error = fmt::Error,
63         Path = Self,
64         Region = Self,
65         Type = Self,
66         DynExistential = Self,
67         Const = Self,
68     > + Printer2<
69         'tcx,
70         Error = fmt::Error,
71         Path = Self,
72         Region = Self,
73         Type = Self,
74         DynExistential = Self,
75         Const = Self,
76     >
77 {
78     //
79 }
80
81 // Some test cases to ensure other cases formatting were not changed
82 fn f() -> Box<
83     FnMut() -> Thing<
84         WithType = LongItemName,
85         Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger,
86     >,
87 > {
88 }
89 fn f() -> Box<
90     FnMut() -> Thing<
91             WithType = LongItemName,
92             Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger,
93         > + fmt::Write1
94         + fmt::Write2,
95 > {
96 }
97
98 fn foo<F>(foo2: F)
99 where
100     F: Fn(
101         // this comment is deleted
102     ),
103 {
104 }
105 fn foo<F>(foo2: F)
106 where
107     F: Fn(
108             // this comment is deleted
109         ) + fmt::Write,
110 {
111 }
112
113 fn elaborate_bounds<F>(mut mk_cand: F)
114 where
115     F: FnMut(
116         &mut ProbeContext,
117         ty::PolyTraitRefffffffffffffffffffffffffffffffff,
118         tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem,
119     ),
120 {
121 }
122 fn elaborate_bounds<F>(mut mk_cand: F)
123 where
124     F: FnMut(
125             &mut ProbeContext,
126             ty::PolyTraitRefffffffffffffffffffffffffffffffff,
127             tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem,
128         ) + fmt::Write,
129 {
130 }
131
132 fn build_sorted_static_get_entry_names(
133     mut entries: entryyyyyyyy,
134 ) -> (impl Fn(
135     AlphabeticalTraversal,
136     Seconddddddddddddddddddddddddddddddddddd,
137 ) -> Parammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
138         + Sendddddddddddddddddddddddddddddddddddddddddddd) {
139 }
140
141 pub trait SomeTrait:
142     Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
143     + Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
144 {
145 }
146
147 trait B = where
148     for<'b> &'b Self: Send
149         + Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
150         + Copyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy;