rust/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr

94 lines
3.1 KiB
Plaintext
Raw Normal View History

error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:14:20
|
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
--> $DIR/fn-or-tuple-struct-without-args.rs:15:16
|
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
--> $DIR/fn-or-tuple-struct-without-args.rs:16:20
|
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
--> $DIR/fn-or-tuple-struct-without-args.rs:17:16
|
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
--> $DIR/fn-or-tuple-struct-without-args.rs:18:20
|
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
--> $DIR/fn-or-tuple-struct-without-args.rs:19:20
|
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}`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0308`.