mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
dfa75391f8
Take into account implicit dereferences when suggesting fields. ``` error[E0609]: no field `longname` on type `Arc<S>` --> $DIR/suggest-field-through-deref.rs:10:15 | LL | let _ = x.longname; | ^^^^^^^^ help: a field with a similar name exists: `long_name` ``` CC https://github.com/rust-lang/rust/issues/78374#issuecomment-719564114
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
error[E0560]: struct `Crate` has no field named `fiel`
|
|
--> $DIR/dont-suggest-hygienic-fields.rs:44:34
|
|
|
|
|
LL | environment!();
|
|
| -------------- in this macro invocation
|
|
...
|
|
LL | const CRATE: Crate = Crate { fiel: () };
|
|
| ^^^^ help: a field with a similar name exists: `field`
|
|
|
|
|
= note: this error originates in the macro `environment` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error[E0609]: no field `field` on type `Compound`
|
|
--> $DIR/dont-suggest-hygienic-fields.rs:24:16
|
|
|
|
|
LL | let _ = ty.field;
|
|
| ^^^^^
|
|
|
|
error[E0609]: no field `fieeld` on type `Compound`
|
|
--> $DIR/dont-suggest-hygienic-fields.rs:25:16
|
|
|
|
|
LL | let _ = ty.fieeld;
|
|
| ^^^^^^
|
|
|
|
error[E0026]: struct `Compound` does not have a field named `field`
|
|
--> $DIR/dont-suggest-hygienic-fields.rs:27:20
|
|
|
|
|
LL | let Compound { field } = ty;
|
|
| ^^^^^ struct `Compound` does not have this field
|
|
|
|
error: pattern requires `..` due to inaccessible fields
|
|
--> $DIR/dont-suggest-hygienic-fields.rs:27:9
|
|
|
|
|
LL | let Compound { field } = ty;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: ignore the inaccessible and unused fields
|
|
|
|
|
LL | let Compound { field, .. } = ty;
|
|
| ++++
|
|
|
|
error[E0609]: no field `0` on type `Component`
|
|
--> $DIR/dont-suggest-hygienic-fields.rs:34:16
|
|
|
|
|
LL | let _ = ty.0;
|
|
| ^
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
Some errors have detailed explanations: E0026, E0560, E0609.
|
|
For more information about an error, try `rustc --explain E0026`.
|