]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/float-field.rs
Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyup
[rust.git] / src / test / ui / parser / float-field.rs
1 struct S(u8, (u8, u8));
2
3 fn main() {
4     let s = S(0, (0, 0));
5
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)`
10     { s.1e+; } //~ ERROR unexpected token: `1e+`
11                //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+`
12                //~| ERROR expected at least one digit in exponent
13     { s.1e-; } //~ ERROR unexpected token: `1e-`
14                //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-`
15                //~| ERROR expected at least one digit in exponent
16     { s.1e+1; } //~ ERROR unexpected token: `1e+1`
17                 //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1`
18     { s.1e-1; } //~ ERROR unexpected token: `1e-1`
19                 //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1`
20     { s.1.1e+1; } //~ ERROR unexpected token: `1.1e+1`
21                   //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1`
22     { s.1.1e-1; } //~ ERROR unexpected token: `1.1e-1`
23                   //~| 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
32     { s.0x1e+; } //~ ERROR expected expression, found `;`
33     { 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`
36     { s.0x1.1e+1; } //~ ERROR unexpected token: `0x1.1e+1`
37                     //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e+1`
38                     //~| ERROR hexadecimal float literal is not supported
39     { s.0x1.1e-1; } //~ ERROR unexpected token: `0x1.1e-1`
40                     //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e-1`
41                     //~| 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
48     { s.1e+f32; } //~ ERROR unexpected token: `1e+f32`
49                   //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+f32`
50                   //~| ERROR expected at least one digit in exponent
51     { s.1e-f32; } //~ ERROR unexpected token: `1e-f32`
52                   //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-f32`
53                   //~| ERROR expected at least one digit in exponent
54     { s.1e+1f32; } //~ ERROR unexpected token: `1e+1f32`
55                    //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1f32`
56     { s.1e-1f32; } //~ ERROR unexpected token: `1e-1f32`
57                    //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1f32`
58     { s.1.1e+1f32; } //~ ERROR unexpected token: `1.1e+1f32`
59                     //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1f32`
60     { s.1.1e-1f32; } //~ ERROR unexpected token: `1.1e-1f32`
61                     //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1f32`
62 }