Skip to content

Commit 7976609

Browse files
committed
Reformat float-field.rs test.
- Put every literal in its own braces, rather than just some of them, for maximal error recovery. - Add a blank line between every case, for readability.
1 parent 951f2d9 commit 7976609

File tree

2 files changed

+142
-113
lines changed

2 files changed

+142
-113
lines changed

tests/ui/parser/float-field.rs

+49-20
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,89 @@ struct S(u8, (u8, u8));
33
fn main() {
44
let s = S(0, (0, 0));
55

6-
s.1e1; //~ ERROR no field `1e1` on type `S`
7-
s.1.; //~ ERROR unexpected token: `;`
8-
s.1.1;
9-
s.1.1e1; //~ ERROR no field `1e1` on type `(u8, u8)`
6+
{ s.1e1; } //~ ERROR no field `1e1` on type `S`
7+
8+
{ s.1.; } //~ ERROR unexpected token: `;`
9+
10+
{ s.1.1; }
11+
12+
{ s.1.1e1; } //~ ERROR no field `1e1` on type `(u8, u8)`
13+
1014
{ s.1e+; } //~ ERROR unexpected token: `1e+`
1115
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+`
1216
//~| ERROR expected at least one digit in exponent
17+
1318
{ s.1e-; } //~ ERROR unexpected token: `1e-`
1419
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-`
1520
//~| ERROR expected at least one digit in exponent
21+
1622
{ s.1e+1; } //~ ERROR unexpected token: `1e+1`
1723
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1`
24+
1825
{ s.1e-1; } //~ ERROR unexpected token: `1e-1`
1926
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1`
27+
2028
{ s.1.1e+1; } //~ ERROR unexpected token: `1.1e+1`
2129
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1`
30+
2231
{ s.1.1e-1; } //~ ERROR unexpected token: `1.1e-1`
2332
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1`
24-
s.0x1e1; //~ ERROR no field `0x1e1` on type `S`
25-
s.0x1.; //~ ERROR no field `0x1` on type `S`
26-
//~| ERROR hexadecimal float literal is not supported
27-
//~| ERROR unexpected token: `;`
28-
s.0x1.1; //~ ERROR no field `0x1` on type `S`
29-
//~| ERROR hexadecimal float literal is not supported
30-
s.0x1.1e1; //~ ERROR no field `0x1` on type `S`
31-
//~| ERROR hexadecimal float literal is not supported
33+
34+
{ s.0x1e1; } //~ ERROR no field `0x1e1` on type `S`
35+
36+
{ s.0x1.; } //~ ERROR no field `0x1` on type `S`
37+
//~| ERROR hexadecimal float literal is not supported
38+
//~| ERROR unexpected token: `;`
39+
40+
{ s.0x1.1; } //~ ERROR no field `0x1` on type `S`
41+
//~| ERROR hexadecimal float literal is not supported
42+
43+
{ s.0x1.1e1; } //~ ERROR no field `0x1` on type `S`
44+
//~| ERROR hexadecimal float literal is not supported
45+
3246
{ s.0x1e+; } //~ ERROR expected expression, found `;`
47+
3348
{ s.0x1e-; } //~ ERROR expected expression, found `;`
34-
s.0x1e+1; //~ ERROR no field `0x1e` on type `S`
35-
s.0x1e-1; //~ ERROR no field `0x1e` on type `S`
49+
50+
{ s.0x1e+1; } //~ ERROR no field `0x1e` on type `S`
51+
52+
{ s.0x1e-1; } //~ ERROR no field `0x1e` on type `S`
53+
3654
{ s.0x1.1e+1; } //~ ERROR unexpected token: `0x1.1e+1`
3755
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e+1`
3856
//~| ERROR hexadecimal float literal is not supported
57+
3958
{ s.0x1.1e-1; } //~ ERROR unexpected token: `0x1.1e-1`
4059
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e-1`
4160
//~| ERROR hexadecimal float literal is not supported
42-
s.1e1f32; //~ ERROR no field `1e1` on type `S`
43-
//~| ERROR suffixes on a tuple index are invalid
44-
s.1.f32; //~ ERROR no field `f32` on type `(u8, u8)`
45-
s.1.1f32; //~ ERROR suffixes on a tuple index are invalid
46-
s.1.1e1f32; //~ ERROR no field `1e1` on type `(u8, u8)`
47-
//~| ERROR suffixes on a tuple index are invalid
61+
62+
{ s.1e1f32; } //~ ERROR no field `1e1` on type `S`
63+
//~| ERROR suffixes on a tuple index are invalid
64+
65+
{ s.1.f32; } //~ ERROR no field `f32` on type `(u8, u8)`
66+
67+
{ s.1.1f32; } //~ ERROR suffixes on a tuple index are invalid
68+
69+
{ s.1.1e1f32; } //~ ERROR no field `1e1` on type `(u8, u8)`
70+
//~| ERROR suffixes on a tuple index are invalid
71+
4872
{ s.1e+f32; } //~ ERROR unexpected token: `1e+f32`
4973
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+f32`
5074
//~| ERROR expected at least one digit in exponent
75+
5176
{ s.1e-f32; } //~ ERROR unexpected token: `1e-f32`
5277
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-f32`
5378
//~| ERROR expected at least one digit in exponent
79+
5480
{ s.1e+1f32; } //~ ERROR unexpected token: `1e+1f32`
5581
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1f32`
82+
5683
{ s.1e-1f32; } //~ ERROR unexpected token: `1e-1f32`
5784
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1f32`
85+
5886
{ s.1.1e+1f32; } //~ ERROR unexpected token: `1.1e+1f32`
5987
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1f32`
88+
6089
{ s.1.1e-1f32; } //~ ERROR unexpected token: `1.1e-1f32`
6190
//~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1f32`
6291
}

0 commit comments

Comments
 (0)