1 error[E0308]: mismatched types
2 --> $DIR/issue-57741.rs:20:9
7 | this match expression has type `std::boxed::Box<T>`
8 | help: consider dereferencing the boxed value: `*x`
9 LL | T::A(a) | T::B(a) => a,
10 | ^^^^^^^ expected struct `std::boxed::Box`, found enum `T`
12 = note: expected struct `std::boxed::Box<T>`
15 error[E0308]: mismatched types
16 --> $DIR/issue-57741.rs:20:19
18 LL | let y = match x {
21 | this match expression has type `std::boxed::Box<T>`
22 | help: consider dereferencing the boxed value: `*x`
23 LL | T::A(a) | T::B(a) => a,
24 | ^^^^^^^ expected struct `std::boxed::Box`, found enum `T`
26 = note: expected struct `std::boxed::Box<T>`
29 error[E0308]: mismatched types
30 --> $DIR/issue-57741.rs:27:9
32 LL | let y = match x {
35 | this match expression has type `std::boxed::Box<S>`
36 | help: consider dereferencing the boxed value: `*x`
37 LL | S::A { a } | S::B { b: a } => a,
38 | ^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `S`
40 = note: expected struct `std::boxed::Box<S>`
43 error[E0308]: mismatched types
44 --> $DIR/issue-57741.rs:27:22
46 LL | let y = match x {
49 | this match expression has type `std::boxed::Box<S>`
50 | help: consider dereferencing the boxed value: `*x`
51 LL | S::A { a } | S::B { b: a } => a,
52 | ^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `S`
54 = note: expected struct `std::boxed::Box<S>`
57 error: aborting due to 4 previous errors
59 For more information about this error, try `rustc --explain E0308`.