]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-5358-1.stderr
Consider privacy more carefully when suggesting accessing fields
[rust.git] / src / test / ui / issues / issue-5358-1.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-5358-1.rs:6:9
3    |
4 LL |     match S(Either::Left(5)) {
5    |           ------------------ this expression has type `S`
6 LL |         Either::Right(_) => {}
7    |         ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either`
8    |
9    = note: expected struct `S`
10                 found enum `Either<_, _>`
11 help: try wrapping the pattern in `S`
12    |
13 LL |         S(Either::Right(_)) => {}
14    |         ++                +
15 help: you might have meant to use field `0` whose type is `Either<usize, usize>`
16    |
17 LL |     match S(Either::Left(5)).0 {
18    |           ~~~~~~~~~~~~~~~~~~~~
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0308`.