fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.6 KiB51 linesraw
1error[E0053]: method `foo` has an incompatible type for trait
2  --> $DIR/issue-35869.rs:11:15
3   |
4LL |     fn foo(_: fn(u8) -> ());
5   |               ------------ type in trait
6...
7LL |     fn foo(_: fn(u16) -> ()) {}
8   |               ^^^^^^^^^^^^^ expected `u8`, found `u16`
9   |
10   = note: expected fn pointer `fn(fn(u8))`
11              found fn pointer `fn(fn(u16))`
12
13error[E0053]: method `bar` has an incompatible type for trait
14  --> $DIR/issue-35869.rs:13:15
15   |
16LL |     fn bar(_: Option<u8>);
17   |               ---------- type in trait
18...
19LL |     fn bar(_: Option<u16>) {}
20   |               ^^^^^^^^^^^ expected `u8`, found `u16`
21   |
22   = note: expected fn pointer `fn(std::option::Option<u8>)`
23              found fn pointer `fn(std::option::Option<u16>)`
24
25error[E0053]: method `baz` has an incompatible type for trait
26  --> $DIR/issue-35869.rs:15:15
27   |
28LL |     fn baz(_: (u8, u16));
29   |               --------- type in trait
30...
31LL |     fn baz(_: (u16, u16)) {}
32   |               ^^^^^^^^^^ expected `u8`, found `u16`
33   |
34   = note: expected fn pointer `fn((u8, _))`
35              found fn pointer `fn((u16, _))`
36
37error[E0053]: method `qux` has an incompatible type for trait
38  --> $DIR/issue-35869.rs:17:17
39   |
40LL |     fn qux() -> u8;
41   |                 -- type in trait
42...
43LL |     fn qux() -> u16 { 5u16 }
44   |                 ^^^ expected `u8`, found `u16`
45   |
46   = note: expected fn pointer `fn() -> u8`
47              found fn pointer `fn() -> u16`
48
49error: aborting due to 4 previous errors
50
51For more information about this error, try `rustc --explain E0053`.