]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-101465.stderr
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / ui / suggestions / issue-101465.stderr
1 error[E0308]: `match` arms have incompatible types
2   --> $DIR/issue-101465.rs:20:18
3    |
4 LL | /     match true {
5 LL | |         true => B,
6    | |                 - this is found to be of type `B`
7 LL | |         false => C,
8    | |                  ^ expected struct `B`, found struct `C`
9 LL | |
10 LL | |     }
11    | |_____- `match` arms have incompatible types
12    |
13 help: you could change the return type to be a boxed trait object
14    |
15 LL | fn foo() -> Box<dyn Tr> {
16    |             ~~~~~~~   +
17 help: if you change the return type to expect trait objects, box the returned expressions
18    |
19 LL ~         true => Box::new(B),
20 LL ~         false => Box::new(C),
21    |
22
23 error: aborting due to previous error
24
25 For more information about this error, try `rustc --explain E0308`.