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