fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
2.0 KiB63 linesraw
1error[E0423]: expected function, found enum `Option`
2  --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
3   |
4LL |     let x = Option(1);
5   |             ^^^^^^
6help: try using one of the enum's variants
7   |
8LL |     let x = std::prelude::v1::Option::None(1);
9   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10LL |     let x = std::prelude::v1::Option::Some(1);
11   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13error[E0532]: expected tuple struct/variant, found enum `Option`
14  --> $DIR/issue-43871-enum-instead-of-variant.rs:21:12
15   |
16LL |     if let Option(_) = x {
17   |            ^^^^^^
18help: try using one of the enum's variants
19   |
20LL |     if let std::prelude::v1::Option::None(_) = x {
21   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22LL |     if let std::prelude::v1::Option::Some(_) = x {
23   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25error[E0532]: expected tuple struct/variant, found enum `Example`
26  --> $DIR/issue-43871-enum-instead-of-variant.rs:27:12
27   |
28LL |     if let Example(_) = y {
29   |            ^^^^^^^
30help: try using one of the enum's variants
31   |
32LL |     if let Example::Ex(_) = y {
33   |            ^^^^^^^^^^^
34LL |     if let Example::NotEx(_) = y {
35   |            ^^^^^^^^^^^^^^
36
37error[E0423]: expected function, found enum `Void`
38  --> $DIR/issue-43871-enum-instead-of-variant.rs:31:13
39   |
40LL |     let y = Void();
41   |             ^^^^
42
43error[E0423]: expected function, found enum `ManyVariants`
44  --> $DIR/issue-43871-enum-instead-of-variant.rs:33:13
45   |
46LL |     let z = ManyVariants();
47   |             ^^^^^^^^^^^^
48help: try using one of the enum's variants
49   |
50LL |     let z = ManyVariants::Eight();
51   |             ^^^^^^^^^^^^^^^^^^^
52LL |     let z = ManyVariants::Five();
53   |             ^^^^^^^^^^^^^^^^^^
54LL |     let z = ManyVariants::Four();
55   |             ^^^^^^^^^^^^^^^^^^
56LL |     let z = ManyVariants::Nine();
57   |             ^^^^^^^^^^^^^^^^^^
58and 6 other candidates
59
60error: aborting due to 5 previous errors
61
62Some errors have detailed explanations: E0423, E0532.
63For more information about an error, try `rustc --explain E0423`.