]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/const-in-struct-pat.stderr
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / const-in-struct-pat.stderr
1 error[E0308]: mismatched types
2   --> $DIR/const-in-struct-pat.rs:8:17
3    |
4 LL | struct foo;
5    | ---------- unit struct defined here
6 ...
7 LL |     let Thing { foo } = t;
8    |                 ^^^     - this expression has type `Thing`
9    |                 |
10    |                 expected struct `String`, found struct `foo`
11    |                 `foo` is interpreted as a unit struct, not a new binding
12    |
13 help: bind the struct field to a different name instead
14    |
15 LL |     let Thing { foo: other_foo } = t;
16    |                    +++++++++++
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0308`.