2019-08-08 16:59:24 -05:00
|
|
|
error[E0423]: expected value, found struct variant `E::B`
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:25:16
|
|
|
|
|
|
|
|
|
LL | let _: E = E::B;
|
|
|
|
| ^^^-
|
|
|
|
| | |
|
|
|
|
| | help: a tuple variant with a similar name exists: `A`
|
|
|
|
| did you mean `E::B { /* fields */ }`?
|
|
|
|
|
2019-08-08 14:01:22 -05:00
|
|
|
error[E0308]: mismatched types
|
2019-08-08 16:59:24 -05:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:18:20
|
2019-08-08 14:01:22 -05:00
|
|
|
|
|
|
|
|
LL | fn foo(a: usize, b: usize) -> usize { a }
|
|
|
|
| ----------------------------------- fn(usize, usize) -> usize {foo} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = foo;
|
|
|
|
| ^^^
|
|
|
|
| |
|
|
|
|
| expected usize, found fn item
|
|
|
|
| help: use parentheses to call this function: `foo(a, b)`
|
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
|
|
|
found type `fn(usize, usize) -> usize {foo}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 16:59:24 -05:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:19:16
|
2019-08-08 14:01:22 -05:00
|
|
|
|
|
|
|
|
LL | struct S(usize, usize);
|
|
|
|
| ----------------------- fn(usize, usize) -> S {S} defined here
|
|
|
|
...
|
|
|
|
LL | let _: S = S;
|
|
|
|
| ^
|
|
|
|
| |
|
|
|
|
| expected struct `S`, found fn item
|
|
|
|
| help: use parentheses to instatiate this tuple struct: `S(_, _)`
|
|
|
|
|
|
|
|
|
= note: expected type `S`
|
|
|
|
found type `fn(usize, usize) -> S {S}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 16:59:24 -05:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:20:20
|
2019-08-08 14:01:22 -05:00
|
|
|
|
|
|
|
|
LL | fn bar() -> usize { 42 }
|
|
|
|
| ----------------- fn() -> usize {bar} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = bar;
|
|
|
|
| ^^^
|
|
|
|
| |
|
|
|
|
| expected usize, found fn item
|
|
|
|
| help: use parentheses to call this function: `bar()`
|
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
|
|
|
found type `fn() -> usize {bar}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 16:59:24 -05:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:21:16
|
2019-08-08 14:01:22 -05:00
|
|
|
|
|
|
|
|
LL | struct V();
|
|
|
|
| ----------- fn() -> V {V} defined here
|
|
|
|
...
|
|
|
|
LL | let _: V = V;
|
|
|
|
| ^
|
|
|
|
| |
|
|
|
|
| expected struct `V`, found fn item
|
|
|
|
| help: use parentheses to instatiate this tuple struct: `V()`
|
|
|
|
|
|
|
|
|
= note: expected type `V`
|
|
|
|
found type `fn() -> V {V}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 16:59:24 -05:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:22:20
|
2019-08-08 14:01:22 -05:00
|
|
|
|
|
|
|
|
LL | fn baz(x: usize, y: usize) -> usize { x }
|
|
|
|
| ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = T::baz;
|
|
|
|
| ^^^^^^
|
|
|
|
| |
|
|
|
|
| expected usize, found fn item
|
|
|
|
| help: use parentheses to call this function: `T::baz(...)`
|
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
|
|
|
found type `fn(usize, usize) -> usize {<_ as T>::baz}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 16:59:24 -05:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:23:20
|
2019-08-08 14:01:22 -05:00
|
|
|
|
|
|
|
|
LL | fn bat() -> usize { 42 }
|
|
|
|
| ----------------- fn() -> usize {<_ as T>::bat} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = T::bat;
|
|
|
|
| ^^^^^^
|
|
|
|
| |
|
|
|
|
| expected usize, found fn item
|
|
|
|
| help: use parentheses to call this function: `T::bat()`
|
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
|
|
|
found type `fn() -> usize {<_ as T>::bat}`
|
|
|
|
|
2019-08-08 16:59:24 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:24:16
|
|
|
|
|
|
|
|
|
LL | A(usize),
|
|
|
|
| -------- fn(usize) -> E {E::A} defined here
|
|
|
|
...
|
|
|
|
LL | let _: E = E::A;
|
|
|
|
| ^^^^
|
|
|
|
| |
|
|
|
|
| expected enum `E`, found fn item
|
|
|
|
| help: use parentheses to instatiate this tuple variant: `E::A(_)`
|
|
|
|
|
|
|
|
|
= note: expected type `E`
|
|
|
|
found type `fn(usize) -> E {E::A}`
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2019-08-08 14:01:22 -05:00
|
|
|
|
2019-08-08 16:59:24 -05:00
|
|
|
Some errors have detailed explanations: E0308, E0423.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|