]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr
Rollup merge of #80935 - pierwill:rustc_middle-levelandsource, r=petrochenkov
[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    |                            ^^^^
21    |                            |
22    |                            types differ in mutability
23    |                            help: consider changing the mutability to match the trait: `&mut Bar`
24    |
25    = note: expected fn pointer `fn(&mut Bar, &mut Bar)`
26               found fn pointer `fn(&mut Bar, &Bar)`
27
28 error: aborting due to 2 previous errors
29
30 For more information about this error, try `rustc --explain E0053`.