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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ----------------------------------- function `foo` defined here
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = foo(/* usize */, /* usize */);
|
|
|
|
| ++++++++++++++++++++++++++
|
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);
|
2023-01-06 03:33:57 +00:00
|
|
|
| -------- `S` defines a struct constructor here, which should be called
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
LL | let _: S = S;
|
2023-01-06 03:09:14 +00:00
|
|
|
| - ^ expected struct `S`, found struct constructor
|
2020-03-12 03:38:21 +00:00
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
2023-01-06 03:09:14 +00:00
|
|
|
= note: expected struct `S`
|
|
|
|
found struct constructor `fn(usize, usize) -> S {S}`
|
2022-10-19 02:53:47 +00:00
|
|
|
help: use parentheses to construct this tuple struct
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-08-28 01:22:51 +00:00
|
|
|
LL | let _: S = S(/* usize */, /* usize */);
|
|
|
|
| ++++++++++++++++++++++++++
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ----------------- function `bar` defined here
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
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();
|
2023-01-06 03:33:57 +00:00
|
|
|
| -------- `V` defines a struct constructor here, which should be called
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
LL | let _: V = V;
|
2023-01-06 03:09:14 +00:00
|
|
|
| - ^ expected struct `V`, found struct constructor
|
2020-03-12 03:38:21 +00:00
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 19:01:22 +00:00
|
|
|
|
|
2023-01-06 03:09:14 +00:00
|
|
|
= note: expected struct `V`
|
|
|
|
found struct constructor `fn() -> V {V}`
|
2022-10-19 02:53:47 +00:00
|
|
|
help: use parentheses to construct this tuple struct
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
|
|
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ----------------------------------- associated function `baz` defined here
|
2019-08-08 19:01:22 +00:00
|
|
|
...
|
|
|
|
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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = T::baz(/* usize */, /* usize */);
|
|
|
|
| ++++++++++++++++++++++++++
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ------------------------- associated function `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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = T::bat(/* usize */);
|
|
|
|
| +++++++++++++
|
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),
|
2023-01-06 03:33:57 +00:00
|
|
|
| - `A` defines an enum variant constructor here, which should be called
|
2019-08-08 21:59:24 +00:00
|
|
|
...
|
|
|
|
LL | let _: E = E::A;
|
2023-01-06 03:09:14 +00:00
|
|
|
| - ^^^^ expected enum `E`, found enum constructor
|
2020-03-12 03:38:21 +00:00
|
|
|
| |
|
2019-11-19 05:00:24 +00:00
|
|
|
| expected due to this
|
2019-08-08 21:59:24 +00:00
|
|
|
|
|
2023-01-06 03:09:14 +00:00
|
|
|
= note: expected enum `E`
|
|
|
|
found enum constructor `fn(usize) -> E {E::A}`
|
2022-10-19 02:53:47 +00:00
|
|
|
help: use parentheses to construct this tuple variant
|
2020-03-12 03:38:21 +00:00
|
|
|
|
|
2022-08-28 01:22:51 +00:00
|
|
|
LL | let _: E = E::A(/* usize */);
|
|
|
|
| +++++++++++++
|
2019-08-08 21:59:24 +00:00
|
|
|
|
2022-10-25 16:15:15 +00:00
|
|
|
error[E0533]: expected value, found struct variant `E::B`
|
|
|
|
--> $DIR/fn-or-tuple-struct-without-args.rs:36:16
|
|
|
|
|
|
|
|
|
LL | let _: E = E::B;
|
|
|
|
| ^^^^ not a value
|
|
|
|
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ----------------------------------- associated function `baz` defined here
|
2019-08-08 22:53:32 +00:00
|
|
|
...
|
|
|
|
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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = X::baz(/* usize */, /* usize */);
|
|
|
|
| ++++++++++++++++++++++++++
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ------------------------- associated function `bat` defined here
|
2019-08-08 22:53:32 +00:00
|
|
|
...
|
|
|
|
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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = X::bat(/* usize */);
|
|
|
|
| +++++++++++++
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ------------------------- associated function `bax` defined here
|
2019-08-08 22:53:32 +00:00
|
|
|
...
|
|
|
|
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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = X::bax(/* usize */);
|
|
|
|
| +++++++++++++
|
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;
|
2023-01-06 03:33:57 +00:00
|
|
|
| --------------------------- associated function `bach` defined here
|
2019-08-08 22:53:32 +00:00
|
|
|
...
|
|
|
|
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-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = X::bach(/* usize */);
|
|
|
|
| +++++++++++++
|
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 }
|
2023-01-06 03:33:57 +00:00
|
|
|
| ---------------------- associated function `ban` defined here
|
2019-08-08 22:53:32 +00:00
|
|
|
...
|
|
|
|
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`
|
2022-09-21 15:57:30 +00:00
|
|
|
found fn item `for<'a> fn(&'a 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
|
|
|
|
|
2022-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = X::ban(/* &X */);
|
|
|
|
| ++++++++++
|
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;
|
2023-01-06 03:33:57 +00:00
|
|
|
| ----------------------- associated function `bal` defined here
|
2019-08-08 22:53:32 +00:00
|
|
|
...
|
|
|
|
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`
|
2022-09-21 15:57:30 +00:00
|
|
|
found fn item `for<'a> fn(&'a 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
|
|
|
|
|
2022-08-28 01:22:51 +00:00
|
|
|
LL | let _: usize = X::bal(/* &X */);
|
|
|
|
| ++++++++++
|
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
|
|
|
|
2022-10-25 16:15:15 +00:00
|
|
|
Some errors have detailed explanations: E0308, E0533, E0615.
|
2019-08-08 21:59:24 +00:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|