]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/trait_type.stderr
Rollup merge of #98441 - calebzulawski:simd_as, r=oli-obk
[rust.git] / src / test / ui / impl-trait / trait_type.stderr
1 error[E0053]: method `fmt` has an incompatible type for trait
2   --> $DIR/trait_type.rs:7:21
3    |
4 LL |    fn fmt(&self, x: &str) -> () { }
5    |                     ^^^^
6    |                     |
7    |                     types differ in mutability
8    |                     help: change the parameter type to match the trait: `&mut Formatter<'_>`
9    |
10    = note: expected fn pointer `fn(&MyType, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
11               found fn pointer `fn(&MyType, &str)`
12
13 error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
14   --> $DIR/trait_type.rs:12:11
15    |
16 LL |    fn fmt(&self) -> () { }
17    |           ^^^^^ expected 2 parameters, found 1
18    |
19    = note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
20
21 error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
22   --> $DIR/trait_type.rs:17:4
23    |
24 LL |    fn fmt() -> () { }
25    |    ^^^^^^^^^^^^^^ expected `&self` in impl
26    |
27    = note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
28
29 error[E0046]: not all trait items implemented, missing: `fmt`
30   --> $DIR/trait_type.rs:21:1
31    |
32 LL | impl std::fmt::Display for MyType4 {}
33    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
34    |
35    = help: implement the missing item: `fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { todo!() }`
36
37 error: aborting due to 4 previous errors
38
39 Some errors have detailed explanations: E0046, E0050, E0053, E0186.
40 For more information about an error, try `rustc --explain E0046`.