fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
667 B20 linesraw
1error[E0308]: mismatched types
2  --> $DIR/const-in-struct-pat.rs:8:17
3   |
4LL | struct foo;
5   | ----------- unit struct defined here
6...
7LL |     let Thing { foo } = t;
8   |                 ^^^     - this expression has type `Thing`
9   |                 |
10   |                 expected struct `std::string::String`, found struct `foo`
11   |                 `foo` is interpreted as a unit struct, not a new binding
12   |
13help: bind the struct field to a different name instead
14   |
15LL |     let Thing { foo: other_foo } = t;
16   |                    ^^^^^^^^^^^
17
18error: aborting due to previous error
19
20For more information about this error, try `rustc --explain E0308`.