]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
0a597eaa1ffcdd718ed333b5b878c124b06b5016
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / uninhabited / coercions.stderr
1 error[E0308]: mismatched types
2   --> $DIR/coercions.rs:23:5
3    |
4 LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A {
5    |                                                                - expected `A` because of return type
6 LL |     x
7    |     ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum`
8    |
9    = note: expected struct `A`
10                 found enum `uninhabited::UninhabitedEnum`
11
12 error[E0308]: mismatched types
13   --> $DIR/coercions.rs:27:5
14    |
15 LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
16    |                                                                               - expected `A` because of return type
17 LL |     x
18    |     ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct`
19    |
20    = note: expected struct `A`
21               found struct `uninhabited::UninhabitedTupleStruct`
22
23 error[E0308]: mismatched types
24   --> $DIR/coercions.rs:31:5
25    |
26 LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
27    |                                                                    - expected `A` because of return type
28 LL |     x
29    |     ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct`
30    |
31    = note: expected struct `A`
32               found struct `uninhabited::UninhabitedStruct`
33
34 error[E0308]: mismatched types
35   --> $DIR/coercions.rs:35:5
36    |
37 LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
38    |                                                                                  - expected `A` because of return type
39 LL |     x
40    |     ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants`
41    |
42    = note: expected struct `A`
43                 found enum `uninhabited::UninhabitedVariants`
44
45 error: aborting due to 4 previous errors
46
47 For more information about this error, try `rustc --explain E0308`.