2019-08-08 21:59:24 +00:00
|
|
|
error[E0423]: expected value, found struct variant `E::B`
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:36:16
|
2019-08-08 21:59:24 +00:00
|
|
|
|
|
2019-10-15 00:20:50 +00:00
|
|
|
LL | A(usize),
|
|
|
|
| -------- similarly named tuple variant `A` defined here
|
2019-09-22 18:27:55 +00:00
|
|
|
LL | B { a: usize },
|
|
|
|
| -------------- `E::B` defined here
|
|
|
|
...
|
2019-08-08 21:59:24 +00:00
|
|
|
LL | let _: E = E::B;
|
2020-07-10 00:42:07 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
help: use struct literal syntax instead
|
|
|
|
|
|
|
|
|
LL | let _: E = E::B { a: val };
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~~~~~~~~~~~~~~
|
2020-08-10 03:29:39 +00:00
|
|
|
help: a tuple variant with a similar name exists
|
|
|
|
|
|
|
|
|
LL | let _: E = E::A;
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~
|
2019-08-08 21:59:24 +00:00
|
|
|
|
2019-08-08 19:01:22 +00:00
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:29:20
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
LL | fn foo(a: usize, b: usize) -> usize { a }
|
|
|
|
| ----------------------------------- fn(usize, usize) -> usize {foo} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = foo;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize, usize) -> usize {foo}`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: use parentheses to call this function
|
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = foo(_, _);
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:30:16
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
LL | struct S(usize, usize);
|
2022-02-13 15:27:59 +00:00
|
|
|
| -------- fn(usize, usize) -> S {S} defined here
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
LL | let _: S = S;
|
2020-03-12 03:38:21 +00:00
|
|
|
| - ^ expected struct `S`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
2019-11-13 22:16:56 +00:00
|
|
|
= note: expected struct `S`
|
|
|
|
found fn item `fn(usize, usize) -> S {S}`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: use parentheses to instantiate this tuple struct
|
|
|
|
|
|
|
|
|
LL | let _: S = S(_, _);
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:31:20
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
LL | fn bar() -> usize { 42 }
|
|
|
|
| ----------------- fn() -> usize {bar} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = bar;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn() -> usize {bar}`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: use parentheses to call this function
|
|
|
|
|
|
|
|
|
LL | let _: usize = bar();
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:32:16
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
LL | struct V();
|
2022-02-13 15:27:59 +00:00
|
|
|
| -------- fn() -> V {V} defined here
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
LL | let _: V = V;
|
2020-03-12 03:38:21 +00:00
|
|
|
| - ^ expected struct `V`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
2019-11-13 22:16:56 +00:00
|
|
|
= note: expected struct `V`
|
|
|
|
found fn item `fn() -> V {V}`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: use parentheses to instantiate this tuple struct
|
|
|
|
|
|
|
|
|
LL | let _: V = V();
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:33:20
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
LL | fn baz(x: usize, y: usize) -> usize { x }
|
|
|
|
| ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = T::baz;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize, usize) -> usize {<_ as T>::baz}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = T::baz(_, _);
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:34:20
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
2019-08-08 22:53:32 +00:00
|
|
|
LL | fn bat(x: usize) -> usize { 42 }
|
|
|
|
| ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
LL | let _: usize = T::bat;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize) -> usize {<_ as T>::bat}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = T::bat(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 19:01:22 +00:00
|
|
|
|
2019-08-08 21:59:24 +00:00
|
|
|
error[E0308]: mismatched types
|
2019-08-08 22:53:32 +00:00
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:35:16
|
2019-08-08 21:59:24 +00:00
|
|
|
|
|
|
|
|
LL | A(usize),
|
2022-07-04 09:13:16 +00:00
|
|
|
| - fn(usize) -> E {E::A} defined here
|
2019-08-08 21:59:24 +00:00
|
|
|
...
|
|
|
|
LL | let _: E = E::A;
|
2020-03-12 03:38:21 +00:00
|
|
|
| - ^^^^ expected enum `E`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 21:59:24 +00:00
|
|
|
|
|
2019-11-13 22:16:56 +00:00
|
|
|
= note: expected enum `E`
|
|
|
|
found fn item `fn(usize) -> E {E::A}`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: use parentheses to instantiate this tuple variant
|
|
|
|
|
|
|
|
|
LL | let _: E = E::A(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 21:59:24 +00:00
|
|
|
|
2019-08-08 22:53:32 +00:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:37:20
|
|
|
|
|
|
|
|
|
LL | fn baz(x: usize, y: usize) -> usize { x }
|
|
|
|
| ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = X::baz;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize, usize) -> usize {<X as T>::baz}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = X::baz(_, _);
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:38:20
|
|
|
|
|
|
|
|
|
LL | fn bat(x: usize) -> usize { 42 }
|
|
|
|
| ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = X::bat;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize) -> usize {<X as T>::bat}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = X::bat(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:39:20
|
|
|
|
|
|
|
|
|
LL | fn bax(x: usize) -> usize { 42 }
|
|
|
|
| ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = X::bax;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize) -> usize {<X as T>::bax}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = X::bax(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:40:20
|
|
|
|
|
|
|
|
|
LL | fn bach(x: usize) -> usize;
|
|
|
|
| --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = X::bach;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `fn(usize) -> usize {<X as T>::bach}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-06-20 06:11:31 +00:00
|
|
|
LL | let _: usize = X::bach(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:41:20
|
|
|
|
|
|
|
|
|
LL | fn ban(&self) -> usize { 42 }
|
|
|
|
| ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = X::ban;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
|
|
|
LL | let _: usize = X::ban(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:42:20
|
|
|
|
|
|
|
|
|
LL | fn bal(&self) -> usize;
|
|
|
|
| ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
|
|
|
|
...
|
|
|
|
LL | let _: usize = X::bal;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^ expected `usize`, found fn item
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2019-11-13 22:16:56 +00:00
|
|
|
found fn item `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
|
2022-08-27 23:08:21 +00:00
|
|
|
help: use parentheses to call this associated function
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
|
|
|
LL | let _: usize = X::bal(_);
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0615]: attempted to take value of method `ban` on type `X`
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:43:22
|
|
|
|
|
|
|
|
|
LL | let _: usize = X.ban;
|
2020-03-22 18:18:06 +00:00
|
|
|
| ^^^ method, not a field
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
|
|
|
help: use parentheses to call the method
|
|
|
|
|
|
|
|
|
LL | let _: usize = X.ban();
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
|
|
|
error[E0615]: attempted to take value of method `bal` on type `X`
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:44:22
|
|
|
|
|
|
|
|
|
LL | let _: usize = X.bal;
|
2020-03-22 18:18:06 +00:00
|
|
|
| ^^^ method, not a field
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
|
|
|
help: use parentheses to call the method
|
|
|
|
|
|
|
|
|
LL | let _: usize = X.bal();
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++
|
2019-08-08 22:53:32 +00:00
|
|
|
|
2019-08-23 18:14:11 +00:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:46:20
|
|
|
|
|
|
|
|
|
LL | let closure = || 42;
|
2022-06-27 05:45:35 +00:00
|
|
|
| -- the found closure
|
2019-08-23 18:14:11 +00:00
|
|
|
LL | let _: usize = closure;
|
2020-03-12 03:38:21 +00:00
|
|
|
| ----- ^^^^^^^ expected `usize`, found closure
|
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-23 18:14:11 +00:00
|
|
|
|
|
|
|
|
= note: expected type `usize`
|
2022-06-27 05:45:35 +00:00
|
|
|
found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:21]`
|
2020-03-12 03:38:21 +00:00
|
|
|
help: use parentheses to call this closure
|
|
|
|
|
|
|
|
|
LL | let _: usize = closure();
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++
|
2019-08-23 18:14:11 +00:00
|
|
|
|
|
|
|
error: aborting due to 17 previous errors
|
2019-08-08 19:01:22 +00:00
|
|
|
|
2019-08-08 22:53:32 +00:00
|
|
|
Some errors have detailed explanations: E0308, E0423, E0615.
|
2019-08-08 21:59:24 +00:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|