]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
Rollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper
[rust.git] / src / test / ui / pattern / issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs:19:9
3    |
4 LL |     let P() = U {};
5    |         ^^^   ---- this expression has type `U`
6    |         |
7    |         expected struct `U`, found struct `P`
8    |
9    = note: expected struct `U`
10               found struct `P<_>`
11
12 error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 1 field
13   --> $DIR/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs:19:9
14    |
15 LL | struct P<T>(T); // 1 type parameter wanted
16    |             - tuple struct has 1 field
17 ...
18 LL |     let P() = U {};
19    |         ^^^ expected 1 field, found 0
20    |
21 help: use `_` to explicitly ignore each field
22    |
23 LL |     let P(_) = U {};
24    |           +
25 help: use `..` to ignore all fields
26    |
27 LL |     let P(..) = U {};
28    |           ++
29
30 error: aborting due to 2 previous errors
31
32 Some errors have detailed explanations: E0023, E0308.
33 For more information about an error, try `rustc --explain E0023`.