]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-57741.rs
Require Drop impls to have the same constness on its bounds as the bounds on the...
[rust.git] / src / test / ui / issues / issue-57741.rs
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
7 enum S {
8     A { a: usize },
9     B { b: usize },
10 }
11
12 enum T {
13     A(usize),
14     B(usize),
15 }
16
17 fn 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 }