fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

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