2017-12-10 22:47:55 +03:00
|
|
|
error[E0053]: method `foo` has an incompatible type for trait
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-35869.rs:11:15
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn foo(_: fn(u16) -> ()) {}
|
2024-07-05 20:58:33 +00:00
|
|
|
| ^^^^^^^^^^^^^ expected `u8`, found `u16`
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2021-12-11 02:20:41 +00:00
|
|
|
note: type in trait
|
|
|
|
--> $DIR/issue-35869.rs:2:15
|
|
|
|
|
|
|
|
|
LL | fn foo(_: fn(u8) -> ());
|
|
|
|
| ^^^^^^^^^^^^
|
2022-12-24 23:17:25 +00:00
|
|
|
= note: expected signature `fn(fn(u8))`
|
|
|
|
found signature `fn(fn(u16))`
|
2024-07-05 20:58:33 +00:00
|
|
|
help: change the parameter type to match the trait
|
|
|
|
|
|
|
|
|
LL | fn foo(_: fn(u8)) {}
|
|
|
|
| ~~~~~~
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
error[E0053]: method `bar` has an incompatible type for trait
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-35869.rs:13:15
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn bar(_: Option<u16>) {}
|
2024-07-05 20:58:33 +00:00
|
|
|
| ^^^^^^^^^^^ expected `u8`, found `u16`
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2021-12-11 02:20:41 +00:00
|
|
|
note: type in trait
|
|
|
|
--> $DIR/issue-35869.rs:3:15
|
|
|
|
|
|
|
|
|
LL | fn bar(_: Option<u8>);
|
|
|
|
| ^^^^^^^^^^
|
2022-12-24 23:17:25 +00:00
|
|
|
= note: expected signature `fn(Option<u8>)`
|
|
|
|
found signature `fn(Option<u16>)`
|
2024-07-05 20:58:33 +00:00
|
|
|
help: change the parameter type to match the trait
|
|
|
|
|
|
|
|
|
LL | fn bar(_: Option<u8>) {}
|
|
|
|
| ~~~~~~~~~~
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
error[E0053]: method `baz` has an incompatible type for trait
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-35869.rs:15:15
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn baz(_: (u16, u16)) {}
|
2024-07-05 20:58:33 +00:00
|
|
|
| ^^^^^^^^^^ expected `u8`, found `u16`
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2021-12-11 02:20:41 +00:00
|
|
|
note: type in trait
|
|
|
|
--> $DIR/issue-35869.rs:4:15
|
|
|
|
|
|
|
|
|
LL | fn baz(_: (u8, u16));
|
|
|
|
| ^^^^^^^^^
|
2022-12-24 23:17:25 +00:00
|
|
|
= note: expected signature `fn((u8, _))`
|
|
|
|
found signature `fn((u16, _))`
|
2024-07-05 20:58:33 +00:00
|
|
|
help: change the parameter type to match the trait
|
|
|
|
|
|
|
|
|
LL | fn baz(_: (u8, u16)) {}
|
|
|
|
| ~~~~~~~~~
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
error[E0053]: method `qux` has an incompatible type for trait
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/issue-35869.rs:17:17
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | fn qux() -> u16 { 5u16 }
|
2024-07-05 20:58:33 +00:00
|
|
|
| ^^^ expected `u8`, found `u16`
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2021-12-11 02:20:41 +00:00
|
|
|
note: type in trait
|
|
|
|
--> $DIR/issue-35869.rs:5:17
|
|
|
|
|
|
|
|
|
LL | fn qux() -> u8;
|
|
|
|
| ^^
|
2022-12-24 23:17:25 +00:00
|
|
|
= note: expected signature `fn() -> u8`
|
|
|
|
found signature `fn() -> u16`
|
2024-07-05 20:58:33 +00:00
|
|
|
help: change the output type to match the trait
|
|
|
|
|
|
|
|
|
LL | fn qux() -> u8 { 5u16 }
|
|
|
|
| ~~
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
2018-03-03 15:59:40 +01:00
|
|
|
For more information about this error, try `rustc --explain E0053`.
|