fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.8 KiB47 linesraw
1error[E0308]: mismatched types
2  --> $DIR/coercions_same_crate.rs:30: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 `UninhabitedEnum`
8   |
9   = note: expected type `A`
10              found type `UninhabitedEnum`
11
12error[E0308]: mismatched types
13  --> $DIR/coercions_same_crate.rs:34:5
14   |
15LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
16   |                                                                               - expected `A` because of return type
17LL |     x
18   |     ^ expected struct `A`, found struct `UninhabitedTupleStruct`
19   |
20   = note: expected type `A`
21              found type `UninhabitedTupleStruct`
22
23error[E0308]: mismatched types
24  --> $DIR/coercions_same_crate.rs:38:5
25   |
26LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
27   |                                                                    - expected `A` because of return type
28LL |     x
29   |     ^ expected struct `A`, found struct `UninhabitedStruct`
30   |
31   = note: expected type `A`
32              found type `UninhabitedStruct`
33
34error[E0308]: mismatched types
35  --> $DIR/coercions_same_crate.rs:42:5
36   |
37LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
38   |                                                                                  - expected `A` because of return type
39LL |     x
40   |     ^ expected struct `A`, found enum `UninhabitedVariants`
41   |
42   = note: expected type `A`
43              found type `UninhabitedVariants`
44
45error: aborting due to 4 previous errors
46
47For more information about this error, try `rustc --explain E0308`.