rust/tests/ui/offset-of/offset-of-self.stderr
Esteban Küber dfa75391f8 Suggest field typo through derefs
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
2023-11-16 17:00:23 +00:00

84 lines
2.3 KiB
Plaintext

error: no rules expected the token `::`
--> $DIR/offset-of-self.rs:20:30
|
LL | offset_of!(Self, Self::v);
| ^^ no rules expected this token in macro call
|
= note: while trying to match sequence start
error: expected identifier, found keyword `Self`
--> $DIR/offset-of-self.rs:21:23
|
LL | offset_of!(S, Self);
| ^^^^ expected identifier, found keyword
error: expected identifier, found keyword `self`
--> $DIR/offset-of-self.rs:54:19
|
LL | offset_of!(S, self);
| ^^^^ expected identifier, found keyword
error: expected identifier, found keyword `self`
--> $DIR/offset-of-self.rs:56:21
|
LL | offset_of!(S, v.self);
| ^^^^ expected identifier, found keyword
error[E0412]: cannot find type `S` in module `self`
--> $DIR/offset-of-self.rs:35:26
|
LL | offset_of!(self::S, v);
| ^ not found in `self`
|
help: consider importing this struct
|
LL + use S;
|
help: if you import `S`, refer to it directly
|
LL - offset_of!(self::S, v);
LL + offset_of!(S, v);
|
error[E0411]: cannot find type `Self` in this scope
--> $DIR/offset-of-self.rs:52:16
|
LL | fn main() {
| ---- `Self` not allowed in a function
LL | offset_of!(self::S, v);
LL | offset_of!(Self, v);
| ^^^^ `Self` is only available in impls, traits, and type definitions
error[E0609]: no field `Self` on type `S`
--> $DIR/offset-of-self.rs:21:23
|
LL | offset_of!(S, Self);
| ^^^^
|
= note: available fields are: `v`, `w`
error[E0616]: field `v` of struct `T` is private
--> $DIR/offset-of-self.rs:41:30
|
LL | offset_of!(Self, v)
| ^ private field
error[E0609]: no field `self` on type `S`
--> $DIR/offset-of-self.rs:54:19
|
LL | offset_of!(S, self);
| ^^^^
|
= note: available fields are: `v`, `w`
error[E0609]: no field `self` on type `u8`
--> $DIR/offset-of-self.rs:56:21
|
LL | offset_of!(S, v.self);
| ^^^^
error: aborting due to 10 previous errors
Some errors have detailed explanations: E0411, E0412, E0609, E0616.
For more information about an error, try `rustc --explain E0411`.