2020-09-29 10:52:43 -05:00
|
|
|
error[E0423]: expected value, found enum `A`
|
2022-08-29 12:44:06 -05:00
|
|
|
--> $DIR/issue-73427.rs:33:5
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
|
LL | A.foo();
|
|
|
|
| ^
|
|
|
|
|
|
2020-10-12 10:43:49 -05:00
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:1:1
|
|
|
|
|
|
|
|
|
LL | / enum A {
|
|
|
|
LL | | StructWithFields { x: () },
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | Struct {},
|
|
|
|
LL | | Tuple(),
|
|
|
|
LL | | Unit,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
help: you might have meant to use one of the following enum variants
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
|
LL | (A::Tuple()).foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~~~~~~
|
2020-09-29 10:52:43 -05:00
|
|
|
LL | A::Unit.foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~
|
2022-10-25 11:15:15 -05:00
|
|
|
help: alternatively, the following enum variant is available
|
2020-10-12 10:43:49 -05:00
|
|
|
|
|
|
|
|
LL | (A::TupleWithFields(/* fields */)).foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
error[E0423]: expected value, found enum `B`
|
2022-08-29 12:44:06 -05:00
|
|
|
--> $DIR/issue-73427.rs:35:5
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
|
LL | B.foo();
|
2022-10-25 11:15:15 -05:00
|
|
|
| ^ help: the following enum variant is available: `(B::TupleWithFields(/* fields */))`
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2020-10-12 10:43:49 -05:00
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:9:1
|
|
|
|
|
|
|
|
|
LL | / enum B {
|
|
|
|
LL | | StructWithFields { x: () },
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
error[E0423]: expected value, found enum `C`
|
2022-08-29 12:44:06 -05:00
|
|
|
--> $DIR/issue-73427.rs:37:5
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
|
LL | C.foo();
|
2020-10-12 10:43:49 -05:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:14:1
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2020-10-12 10:43:49 -05:00
|
|
|
LL | / enum C {
|
|
|
|
LL | | StructWithFields { x: () },
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | Unit,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
help: you might have meant to use the following enum variant
|
|
|
|
|
|
|
|
|
LL | C::Unit.foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~
|
2022-10-25 11:15:15 -05:00
|
|
|
help: alternatively, the following enum variant is available
|
2020-10-12 10:43:49 -05:00
|
|
|
|
|
|
|
|
LL | (C::TupleWithFields(/* fields */)).foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
error[E0423]: expected value, found enum `D`
|
2022-08-29 12:44:06 -05:00
|
|
|
--> $DIR/issue-73427.rs:39:5
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
|
LL | D.foo();
|
2020-10-12 10:43:49 -05:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:20:1
|
|
|
|
|
|
|
|
|
LL | / enum D {
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | Unit,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
help: you might have meant to use the following enum variant
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2020-10-12 10:43:49 -05:00
|
|
|
LL | D::Unit.foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~
|
2022-08-29 12:44:06 -05:00
|
|
|
help: alternatively, the following enum variant is available
|
2020-10-12 10:43:49 -05:00
|
|
|
|
|
|
|
|
LL | (D::TupleWithFields(/* fields */)).foo();
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-09-29 10:52:43 -05:00
|
|
|
|
2022-08-29 12:44:06 -05:00
|
|
|
error[E0423]: expected value, found enum `E`
|
|
|
|
--> $DIR/issue-73427.rs:41:5
|
|
|
|
|
|
|
|
|
LL | E.foo();
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:25:1
|
|
|
|
|
|
|
|
|
LL | / enum E {
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
help: the following enum variant is available
|
|
|
|
|
|
|
|
|
LL | (E::TupleWithFields(/* fields */)).foo();
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: consider importing one of these items instead
|
|
|
|
|
|
|
|
|
LL | use std::f32::consts::E;
|
|
|
|
|
|
|
|
|
LL | use std::f64::consts::E;
|
|
|
|
|
|
|
|
|
|
2022-10-05 00:35:34 -05:00
|
|
|
error[E0532]: expected tuple struct or tuple variant, found enum `A`
|
|
|
|
--> $DIR/issue-73427.rs:48:12
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2022-10-05 00:35:34 -05:00
|
|
|
LL | if let A(3) = x { }
|
|
|
|
| ^
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2022-10-25 11:15:15 -05:00
|
|
|
= help: you might have meant to match against the enum's non-tuple variant
|
2020-10-12 10:43:49 -05:00
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:1:1
|
|
|
|
|
|
|
|
|
LL | / enum A {
|
|
|
|
LL | | StructWithFields { x: () },
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | Struct {},
|
|
|
|
LL | | Tuple(),
|
|
|
|
LL | | Unit,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2022-10-05 00:35:34 -05:00
|
|
|
help: try to match against one of the enum's variants
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2022-10-05 00:35:34 -05:00
|
|
|
LL | if let A::Tuple(3) = x { }
|
|
|
|
| ~~~~~~~~
|
|
|
|
LL | if let A::TupleWithFields(3) = x { }
|
|
|
|
| ~~~~~~~~~~~~~~~~~~
|
2020-09-29 10:52:43 -05:00
|
|
|
|
2022-10-05 00:35:34 -05:00
|
|
|
error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
|
|
|
|
--> $DIR/issue-73427.rs:46:13
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2022-10-05 00:35:34 -05:00
|
|
|
LL | let x = A(3);
|
|
|
|
| ^
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2022-10-25 11:15:15 -05:00
|
|
|
= help: you might have meant to construct the enum's non-tuple variant
|
2020-10-12 10:43:49 -05:00
|
|
|
note: the enum is defined here
|
|
|
|
--> $DIR/issue-73427.rs:1:1
|
|
|
|
|
|
|
|
|
LL | / enum A {
|
|
|
|
LL | | StructWithFields { x: () },
|
|
|
|
LL | | TupleWithFields(()),
|
|
|
|
LL | | Struct {},
|
|
|
|
LL | | Tuple(),
|
|
|
|
LL | | Unit,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2022-10-05 00:35:34 -05:00
|
|
|
help: try to construct one of the enum's variants
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
2022-10-05 00:35:34 -05:00
|
|
|
LL | let x = A::Tuple(3);
|
|
|
|
| ~~~~~~~~
|
|
|
|
LL | let x = A::TupleWithFields(3);
|
|
|
|
| ~~~~~~~~~~~~~~~~~~
|
2020-09-29 10:52:43 -05:00
|
|
|
|
2022-08-29 12:44:06 -05:00
|
|
|
error: aborting due to 7 previous errors
|
2020-09-29 10:52:43 -05:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0423, E0532.
|
|
|
|
For more information about an error, try `rustc --explain E0423`.
|