fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
624 B31 linesraw
1// run-rustfix
2
3#![allow(warnings)]
4
5// This tests that the `help: consider dereferencing the boxed value` suggestion is made and works.
6
7enum S {
8    A { a: usize },
9    B { b: usize },
10}
11
12enum T {
13    A(usize),
14    B(usize),
15}
16
17fn main() {
18    let x = Box::new(T::A(3));
19    let y = match *x {
20        T::A(a) | T::B(a) => a,
21        //~^ ERROR mismatched types [E0308]
22        //~^^ ERROR mismatched types [E0308]
23    };
24
25    let x = Box::new(S::A { a: 3 });
26    let y = match *x {
27        S::A { a } | S::B { b: a } => a,
28        //~^ ERROR mismatched types [E0308]
29        //~^^ ERROR mismatched types [E0308]
30    };
31}