]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr
Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyup
[rust.git] / src / test / ui / mismatched_types / trait-impl-fn-incompatibility.stderr
1 error[E0053]: method `foo` has an incompatible type for trait
2   --> $DIR/trait-impl-fn-incompatibility.rs:9:15
3    |
4 LL |     fn foo(x: u16);
5    |               --- type in trait
6 ...
7 LL |     fn foo(x: i16) { }
8    |               ^^^ expected `u16`, found `i16`
9    |
10    = note: expected fn pointer `fn(u16)`
11               found fn pointer `fn(i16)`
12
13 error[E0053]: method `bar` has an incompatible type for trait
14   --> $DIR/trait-impl-fn-incompatibility.rs:10:28
15    |
16 LL |     fn bar(&mut self, bar: &mut Bar);
17    |                            -------- type in trait
18 ...
19 LL |     fn bar(&mut self, bar: &Bar) { }
20    |                            ^^^^ types differ in mutability
21    |
22    = note: expected fn pointer `fn(&mut Bar, &mut Bar)`
23               found fn pointer `fn(&mut Bar, &Bar)`
24 help: consider change the type to match the mutability in trait
25    |
26 LL |     fn bar(&mut self, bar: &mut Bar) { }
27    |                            ^^^^^^^^
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0053`.