1 error[E0308]: mismatched types
2 --> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:9:30
4 LL | fn not_all_paths(a: &str) -> u32 {
5 | ------------- ^^^ expected `u32`, found `()`
7 | implicitly returns `()` as its body has no tail or `return` expression
10 | - help: consider removing this semicolon
12 error[E0308]: `match` arms have incompatible types
13 --> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:26:14
16 LL | | "baz" => Box::new(Baz),
17 | | ------------- this is found to be of type `Box<Baz>`
18 LL | | _ => Box::new(Bar),
19 | | ^^^^^^^^^^^^^ expected struct `Baz`, found struct `Bar`
21 | |_____- `match` arms have incompatible types
23 = note: expected type `Box<Baz>`
24 found struct `Box<Bar>`
25 note: you might have meant to return the `match` expression
26 --> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:27:6
28 LL | fn wrong(c: &str) -> Box<dyn Foo> {
29 | ------------ the `match` arms can conform to this return type
31 LL | | "baz" => Box::new(Baz),
32 LL | | _ => Box::new(Bar),
34 | | -^ the `match` is a statement because of this semicolon, consider removing it
36 | this could be implicitly returned but it is a statement, not a tail expression
38 error[E0308]: mismatched types
39 --> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:23:22
41 LL | fn wrong(c: &str) -> Box<dyn Foo> {
42 | ----- ^^^^^^^^^^^^ expected struct `Box`, found `()`
44 | implicitly returns `()` as its body has no tail or `return` expression
46 = note: expected struct `Box<(dyn Foo + 'static)>`
49 error: aborting due to 3 previous errors
51 For more information about this error, try `rustc --explain E0308`.