Skip to content

Commit 5b4a063

Browse files
committed
Test files for each Verion One and Two
1 parent 0bbfdea commit 5b4a063

File tree

4 files changed

+325
-0
lines changed

4 files changed

+325
-0
lines changed

tests/source/issue-4689.rs renamed to tests/source/issue-4689/one.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// rustfmt-version: One
2+
13
// Based on the issue description
24
pub trait PrettyPrinter<'tcx>:
35
Printer<
@@ -124,6 +126,17 @@ tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem,
124126
{
125127
}
126128

129+
fn build_sorted_static_get_entry_names(
130+
mut entries: entryyyyyyyy,
131+
) -> (
132+
impl Fn(
133+
AlphabeticalTraversal,
134+
Seconddddddddddddddddddddddddddddddddddd
135+
) -> Parammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
136+
+ Sendddddddddddddddddddddddddddddddddddddddddddd
137+
) {
138+
}
139+
127140
pub trait SomeTrait:
128141
Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
129142
+ Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

tests/source/issue-4689/two.rs

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
// rustfmt-version: Two
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 + fmt::Write2
40+
{
41+
//
42+
}
43+
pub trait PrettyPrinter<'tcx>:
44+
fmt::Write + Printer<
45+
'tcx,
46+
Error = fmt::Error,
47+
Path = Self,
48+
Region = Self,
49+
Type = Self,
50+
DynExistential = Self,
51+
Const = Self,
52+
>
53+
{
54+
//
55+
}
56+
pub trait PrettyPrinter<'tcx>:
57+
fmt::Write + Printer1<
58+
'tcx,
59+
Error = fmt::Error,
60+
Path = Self,
61+
Region = Self,
62+
Type = Self,
63+
DynExistential = Self,
64+
Const = Self,
65+
> + Printer2<
66+
'tcx,
67+
Error = fmt::Error,
68+
Path = Self,
69+
Region = Self,
70+
Type = Self,
71+
DynExistential = Self,
72+
Const = Self,
73+
>
74+
{
75+
//
76+
}
77+
78+
// Some test cases to ensure other cases formatting were not changed
79+
fn f() -> Box<
80+
FnMut() -> Thing<
81+
WithType = LongItemName,
82+
Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger,
83+
>,
84+
> {
85+
}
86+
fn f() -> Box<
87+
FnMut() -> Thing<
88+
WithType = LongItemName,
89+
Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger,
90+
> + fmt::Write1
91+
+ fmt::Write2,
92+
> {
93+
}
94+
95+
fn foo<F>(foo2: F)
96+
where
97+
F: Fn(
98+
// this comment is deleted
99+
)
100+
{
101+
}
102+
fn foo<F>(foo2: F)
103+
where
104+
F: Fn(
105+
// this comment is deleted
106+
) + fmt::Write
107+
{
108+
}
109+
110+
fn elaborate_bounds<F>(mut mk_cand: F)
111+
where
112+
F: for<> FnMut(
113+
&mut ProbeContext<>,
114+
ty::PolyTraitRefffffffffffffffffffffffffffffffff<>,
115+
tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem,
116+
),
117+
{
118+
}
119+
fn elaborate_bounds<F>(mut mk_cand: F)
120+
where
121+
F: for<> FnMut(
122+
&mut ProbeContext<>,
123+
ty::PolyTraitRefffffffffffffffffffffffffffffffff<>,
124+
tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem,
125+
) + fmt::Write,
126+
{
127+
}
128+
129+
fn build_sorted_static_get_entry_names(
130+
mut entries: entryyyyyyyy,
131+
) -> (
132+
impl Fn(
133+
AlphabeticalTraversal,
134+
Seconddddddddddddddddddddddddddddddddddd
135+
) -> Parammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
136+
+ Sendddddddddddddddddddddddddddddddddddddddddddd
137+
) {
138+
}
139+
140+
pub trait SomeTrait:
141+
Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
142+
+ Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
143+
{
144+
}
145+
146+
trait B = where
147+
for<'b> &'b Self: Send
148+
+ Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
149+
+ Copyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy;

tests/target/issue-4689.rs renamed to tests/target/issue-4689/one.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// rustfmt-version: One
2+
13
// Based on the issue description
24
pub trait PrettyPrinter<'tcx>:
35
Printer<
@@ -127,6 +129,15 @@ where
127129
{
128130
}
129131

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+
130141
pub trait SomeTrait:
131142
Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
132143
+ Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

tests/target/issue-4689/two.rs

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
// rustfmt-version: Two
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+
) -> (
135+
impl Fn(
136+
AlphabeticalTraversal,
137+
Seconddddddddddddddddddddddddddddddddddd,
138+
) -> Parammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
139+
+ Sendddddddddddddddddddddddddddddddddddddddddddd
140+
) {
141+
}
142+
143+
pub trait SomeTrait:
144+
Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
145+
+ Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
146+
{
147+
}
148+
149+
trait B = where
150+
for<'b> &'b Self: Send
151+
+ Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
152+
+ Copyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy;

0 commit comments

Comments
 (0)