mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00

When looking for the field names and types of a given type, account for tuples. This allows suggestions for incorrectly nested field accesses and field name typos to trigger as intended. Previously these suggestions only worked on `ty::Adt`, including tuple structs which are no different to tuples, so they should behave the same in suggestions. ``` error[E0599]: no method named `get_ref` found for tuple `(BufReader<File>,)` in the current scope --> $DIR/missing-field-access.rs:11:15 | LL | let x = f.get_ref(); | ^^^^^^^ method not found in `(BufReader<File>,)` | help: one of the expressions' fields has a method of the same name | LL | let x = f.0.get_ref(); | ++ ```
362 lines
8.8 KiB
Plaintext
362 lines
8.8 KiB
Plaintext
error: expected at least one digit in exponent
|
|
--> $DIR/float-field.rs:14:9
|
|
|
|
|
LL | { s.1e+; }
|
|
| ^^^
|
|
|
|
error: expected at least one digit in exponent
|
|
--> $DIR/float-field.rs:18:9
|
|
|
|
|
LL | { s.1e-; }
|
|
| ^^^
|
|
|
|
error: hexadecimal float literal is not supported
|
|
--> $DIR/float-field.rs:36:9
|
|
|
|
|
LL | { s.0x1.; }
|
|
| ^^^^
|
|
|
|
error: hexadecimal float literal is not supported
|
|
--> $DIR/float-field.rs:40:9
|
|
|
|
|
LL | { s.0x1.1; }
|
|
| ^^^^^
|
|
|
|
error: hexadecimal float literal is not supported
|
|
--> $DIR/float-field.rs:44:9
|
|
|
|
|
LL | { s.0x1.1e1; }
|
|
| ^^^^^^^
|
|
|
|
error: hexadecimal float literal is not supported
|
|
--> $DIR/float-field.rs:56:9
|
|
|
|
|
LL | { s.0x1.1e+1; }
|
|
| ^^^^^^^^
|
|
|
|
error: hexadecimal float literal is not supported
|
|
--> $DIR/float-field.rs:60:9
|
|
|
|
|
LL | { s.0x1.1e-1; }
|
|
| ^^^^^^^^
|
|
|
|
error: expected at least one digit in exponent
|
|
--> $DIR/float-field.rs:74:9
|
|
|
|
|
LL | { s.1e+f32; }
|
|
| ^^^^^^
|
|
|
|
error: expected at least one digit in exponent
|
|
--> $DIR/float-field.rs:78:9
|
|
|
|
|
LL | { s.1e-f32; }
|
|
| ^^^^^^
|
|
|
|
error: unexpected token: `;`
|
|
--> $DIR/float-field.rs:8:11
|
|
|
|
|
LL | { s.1.; }
|
|
| ^
|
|
|
|
error: unexpected token: `1e+`
|
|
--> $DIR/float-field.rs:14:9
|
|
|
|
|
LL | { s.1e+; }
|
|
| ^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+`
|
|
--> $DIR/float-field.rs:14:9
|
|
|
|
|
LL | { s.1e+; }
|
|
| ^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1e-`
|
|
--> $DIR/float-field.rs:18:9
|
|
|
|
|
LL | { s.1e-; }
|
|
| ^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-`
|
|
--> $DIR/float-field.rs:18:9
|
|
|
|
|
LL | { s.1e-; }
|
|
| ^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1e+1`
|
|
--> $DIR/float-field.rs:22:9
|
|
|
|
|
LL | { s.1e+1; }
|
|
| ^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1`
|
|
--> $DIR/float-field.rs:22:9
|
|
|
|
|
LL | { s.1e+1; }
|
|
| ^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1e-1`
|
|
--> $DIR/float-field.rs:25:9
|
|
|
|
|
LL | { s.1e-1; }
|
|
| ^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1`
|
|
--> $DIR/float-field.rs:25:9
|
|
|
|
|
LL | { s.1e-1; }
|
|
| ^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1.1e+1`
|
|
--> $DIR/float-field.rs:28:9
|
|
|
|
|
LL | { s.1.1e+1; }
|
|
| ^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1`
|
|
--> $DIR/float-field.rs:28:9
|
|
|
|
|
LL | { s.1.1e+1; }
|
|
| ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1.1e-1`
|
|
--> $DIR/float-field.rs:31:9
|
|
|
|
|
LL | { s.1.1e-1; }
|
|
| ^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1`
|
|
--> $DIR/float-field.rs:31:9
|
|
|
|
|
LL | { s.1.1e-1; }
|
|
| ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `0x1.`
|
|
--> $DIR/float-field.rs:36:9
|
|
|
|
|
LL | { s.0x1.; }
|
|
| ^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.`
|
|
--> $DIR/float-field.rs:36:9
|
|
|
|
|
LL | { s.0x1.; }
|
|
| ^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `0x1.1`
|
|
--> $DIR/float-field.rs:40:9
|
|
|
|
|
LL | { s.0x1.1; }
|
|
| ^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1`
|
|
--> $DIR/float-field.rs:40:9
|
|
|
|
|
LL | { s.0x1.1; }
|
|
| ^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `0x1.1e1`
|
|
--> $DIR/float-field.rs:44:9
|
|
|
|
|
LL | { s.0x1.1e1; }
|
|
| ^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e1`
|
|
--> $DIR/float-field.rs:44:9
|
|
|
|
|
LL | { s.0x1.1e1; }
|
|
| ^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: expected expression, found `;`
|
|
--> $DIR/float-field.rs:48:14
|
|
|
|
|
LL | { s.0x1e+; }
|
|
| ^ expected expression
|
|
|
|
error: expected expression, found `;`
|
|
--> $DIR/float-field.rs:50:14
|
|
|
|
|
LL | { s.0x1e-; }
|
|
| ^ expected expression
|
|
|
|
error: unexpected token: `0x1.1e+1`
|
|
--> $DIR/float-field.rs:56:9
|
|
|
|
|
LL | { s.0x1.1e+1; }
|
|
| ^^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e+1`
|
|
--> $DIR/float-field.rs:56:9
|
|
|
|
|
LL | { s.0x1.1e+1; }
|
|
| ^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `0x1.1e-1`
|
|
--> $DIR/float-field.rs:60:9
|
|
|
|
|
LL | { s.0x1.1e-1; }
|
|
| ^^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `0x1.1e-1`
|
|
--> $DIR/float-field.rs:60:9
|
|
|
|
|
LL | { s.0x1.1e-1; }
|
|
| ^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: suffixes on a tuple index are invalid
|
|
--> $DIR/float-field.rs:64:9
|
|
|
|
|
LL | { s.1e1f32; }
|
|
| ^^^^^^ invalid suffix `f32`
|
|
|
|
error: suffixes on a tuple index are invalid
|
|
--> $DIR/float-field.rs:69:9
|
|
|
|
|
LL | { s.1.1f32; }
|
|
| ^^^^^^ invalid suffix `f32`
|
|
|
|
error: suffixes on a tuple index are invalid
|
|
--> $DIR/float-field.rs:71:9
|
|
|
|
|
LL | { s.1.1e1f32; }
|
|
| ^^^^^^^^ invalid suffix `f32`
|
|
|
|
error: unexpected token: `1e+f32`
|
|
--> $DIR/float-field.rs:74:9
|
|
|
|
|
LL | { s.1e+f32; }
|
|
| ^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+f32`
|
|
--> $DIR/float-field.rs:74:9
|
|
|
|
|
LL | { s.1e+f32; }
|
|
| ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1e-f32`
|
|
--> $DIR/float-field.rs:78:9
|
|
|
|
|
LL | { s.1e-f32; }
|
|
| ^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-f32`
|
|
--> $DIR/float-field.rs:78:9
|
|
|
|
|
LL | { s.1e-f32; }
|
|
| ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1e+1f32`
|
|
--> $DIR/float-field.rs:82:9
|
|
|
|
|
LL | { s.1e+1f32; }
|
|
| ^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e+1f32`
|
|
--> $DIR/float-field.rs:82:9
|
|
|
|
|
LL | { s.1e+1f32; }
|
|
| ^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1e-1f32`
|
|
--> $DIR/float-field.rs:85:9
|
|
|
|
|
LL | { s.1e-1f32; }
|
|
| ^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1e-1f32`
|
|
--> $DIR/float-field.rs:85:9
|
|
|
|
|
LL | { s.1e-1f32; }
|
|
| ^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1.1e+1f32`
|
|
--> $DIR/float-field.rs:88:9
|
|
|
|
|
LL | { s.1.1e+1f32; }
|
|
| ^^^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e+1f32`
|
|
--> $DIR/float-field.rs:88:9
|
|
|
|
|
LL | { s.1.1e+1f32; }
|
|
| ^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error: unexpected token: `1.1e-1f32`
|
|
--> $DIR/float-field.rs:91:9
|
|
|
|
|
LL | { s.1.1e-1f32; }
|
|
| ^^^^^^^^^
|
|
|
|
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1e-1f32`
|
|
--> $DIR/float-field.rs:91:9
|
|
|
|
|
LL | { s.1.1e-1f32; }
|
|
| ^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
|
|
|
error[E0609]: no field `1e1` on type `S`
|
|
--> $DIR/float-field.rs:6:9
|
|
|
|
|
LL | { s.1e1; }
|
|
| ^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `1e1` on type `(u8, u8)`
|
|
--> $DIR/float-field.rs:12:11
|
|
|
|
|
LL | { s.1.1e1; }
|
|
| ^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `0x1e1` on type `S`
|
|
--> $DIR/float-field.rs:34:9
|
|
|
|
|
LL | { s.0x1e1; }
|
|
| ^^^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `0x1e` on type `S`
|
|
--> $DIR/float-field.rs:52:9
|
|
|
|
|
LL | { s.0x1e+1; }
|
|
| ^^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `0x1e` on type `S`
|
|
--> $DIR/float-field.rs:54:9
|
|
|
|
|
LL | { s.0x1e-1; }
|
|
| ^^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `1e1` on type `S`
|
|
--> $DIR/float-field.rs:64:9
|
|
|
|
|
LL | { s.1e1f32; }
|
|
| ^^^^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `f32` on type `(u8, u8)`
|
|
--> $DIR/float-field.rs:67:11
|
|
|
|
|
LL | { s.1.f32; }
|
|
| ^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error[E0609]: no field `1e1` on type `(u8, u8)`
|
|
--> $DIR/float-field.rs:71:9
|
|
|
|
|
LL | { s.1.1e1f32; }
|
|
| ^^^^^^^^ unknown field
|
|
|
|
|
= note: available fields are: `0`, `1`
|
|
|
|
error: aborting due to 57 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0609`.
|