fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.5 KiB35 linesraw
1error[E0308]: mismatched types
2  --> $DIR/coercions.rs:23:5
3   |
4LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A {
5   |                                                                - expected `A` because of return type
6LL |     x
7   |     ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum`
8
9error[E0308]: mismatched types
10  --> $DIR/coercions.rs:27:5
11   |
12LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
13   |                                                                               - expected `A` because of return type
14LL |     x
15   |     ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct`
16
17error[E0308]: mismatched types
18  --> $DIR/coercions.rs:31:5
19   |
20LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
21   |                                                                    - expected `A` because of return type
22LL |     x
23   |     ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct`
24
25error[E0308]: mismatched types
26  --> $DIR/coercions.rs:35:5
27   |
28LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
29   |                                                                                  - expected `A` because of return type
30LL |     x
31   |     ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants`
32
33error: aborting due to 4 previous errors
34
35For more information about this error, try `rustc --explain E0308`.