File: trait-impl-argument-difference-ice.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (60 lines) | stat: -rw-r--r-- 2,873 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
warning: anonymous parameters are deprecated and will be removed in the next edition
  --> $DIR/trait-impl-argument-difference-ice.rs:4:30
   |
LL |     extern "C" fn read_dword(Self::Assoc<'_>) -> u16;
   |                              ^^^^^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: Self::Assoc<'_>`
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
   = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
   = note: `#[warn(anonymous_parameters)]` on by default

error[E0220]: associated type `Assoc` not found for `Self`
  --> $DIR/trait-impl-argument-difference-ice.rs:4:36
   |
LL |     extern "C" fn read_dword(Self::Assoc<'_>) -> u16;
   |                                    ^^^^^ associated type `Assoc` not found

error[E0185]: method `read_dword` has a `&self` declaration in the impl, but not in the trait
  --> $DIR/trait-impl-argument-difference-ice.rs:14:5
   |
LL |     extern "C" fn read_dword(Self::Assoc<'_>) -> u16;
   |     ------------------------------------------------- trait method declared without `&self`
...
LL |     extern "C" fn read_dword(&'_ self) -> u16 {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl

error[E0046]: not all trait items implemented, missing: `read_word`
  --> $DIR/trait-impl-argument-difference-ice.rs:12:1
   |
LL |     extern "C" fn read_word(&mut self) -> u8;
   |     ----------------------------------------- `read_word` from trait
...
LL | impl MemoryUnit for ROM {
   | ^^^^^^^^^^^^^^^^^^^^^^^ missing `read_word` in implementation

error[E0596]: cannot borrow `*self` as mutable, as it is behind a `&` reference
  --> $DIR/trait-impl-argument-difference-ice.rs:16:19
   |
LL |         let a16 = self.read_word() as u16;
   |                   ^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition
   |
LL |     extern "C" fn read_dword(&'_ mut self) -> u16 {
   |                              ~~~~~~~~~~~~

error[E0596]: cannot borrow `*self` as mutable, as it is behind a `&` reference
  --> $DIR/trait-impl-argument-difference-ice.rs:18:19
   |
LL |         let b16 = self.read_word() as u16;
   |                   ^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition
   |
LL |     extern "C" fn read_dword(&'_ mut self) -> u16 {
   |                              ~~~~~~~~~~~~

error: aborting due to 5 previous errors; 1 warning emitted

Some errors have detailed explanations: E0046, E0185, E0220, E0596.
For more information about an error, try `rustc --explain E0046`.