1 error[E0308]: `match` arms have incompatible types
2 --> $DIR/issue-101465.rs:20:18
6 | | - this is found to be of type `B`
8 | | ^ expected struct `B`, found struct `C`
11 | |_____- `match` arms have incompatible types
13 help: you could change the return type to be a boxed trait object
15 LL | fn foo() -> Box<dyn Tr> {
17 help: if you change the return type to expect trait objects, box the returned expressions
19 LL ~ true => Box::new(B),
20 LL ~ false => Box::new(C),
23 error: aborting due to previous error
25 For more information about this error, try `rustc --explain E0308`.