]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr
Rollup merge of #106889 - scottmcm:windows-mut, r=cuviper
[rust.git] / tests / 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: i16) { }
5    |               ^^^
6    |               |
7    |               expected `u16`, found `i16`
8    |               help: change the parameter type to match the trait: `u16`
9    |
10 note: type in trait
11   --> $DIR/trait-impl-fn-incompatibility.rs:2:15
12    |
13 LL |     fn foo(x: u16);
14    |               ^^^
15    = note: expected signature `fn(u16)`
16               found signature `fn(i16)`
17
18 error[E0053]: method `bar` has an incompatible type for trait
19   --> $DIR/trait-impl-fn-incompatibility.rs:10:28
20    |
21 LL |     fn bar(&mut self, bar: &Bar) { }
22    |                            ^^^^
23    |                            |
24    |                            types differ in mutability
25    |                            help: change the parameter type to match the trait: `&mut Bar`
26    |
27 note: type in trait
28   --> $DIR/trait-impl-fn-incompatibility.rs:3:28
29    |
30 LL |     fn bar(&mut self, bar: &mut Bar);
31    |                            ^^^^^^^^
32    = note: expected signature `fn(&mut Bar, &mut Bar)`
33               found signature `fn(&mut Bar, &Bar)`
34
35 error: aborting due to 2 previous errors
36
37 For more information about this error, try `rustc --explain E0053`.