1 error[E0308]: mismatched types
2 --> $DIR/coercions.rs:23:5
4 LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A {
5 | - expected `A` because of return type
7 | ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum`
9 = note: expected type `A`
10 found type `uninhabited::UninhabitedEnum`
12 error[E0308]: mismatched types
13 --> $DIR/coercions.rs:27:5
15 LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
16 | - expected `A` because of return type
18 | ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct`
20 = note: expected type `A`
21 found type `uninhabited::UninhabitedTupleStruct`
23 error[E0308]: mismatched types
24 --> $DIR/coercions.rs:31:5
26 LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
27 | - expected `A` because of return type
29 | ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct`
31 = note: expected type `A`
32 found type `uninhabited::UninhabitedStruct`
34 error[E0308]: mismatched types
35 --> $DIR/coercions.rs:35:5
37 LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
38 | - expected `A` because of return type
40 | ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants`
42 = note: expected type `A`
43 found type `uninhabited::UninhabitedVariants`
45 error: aborting due to 4 previous errors
47 For more information about this error, try `rustc --explain E0308`.