File: wrong-mul-method-signature.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 893,176 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; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (59 lines) | stat: -rw-r--r-- 2,167 bytes parent folder | download | duplicates (3)
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
error[E0053]: method `mul` has an incompatible type for trait
  --> $DIR/wrong-mul-method-signature.rs:16:21
   |
LL |     fn mul(self, s: &f64) -> Vec1 {
   |                     ^^^^ expected `f64`, found `&f64`
   |
   = note: expected signature `fn(Vec1, _) -> Vec1`
              found signature `fn(Vec1, &_) -> Vec1`
help: change the parameter type to match the trait
   |
LL |     fn mul(self, s: f64) -> Vec1 {
   |                     ~~~

error[E0053]: method `mul` has an incompatible type for trait
  --> $DIR/wrong-mul-method-signature.rs:33:21
   |
LL |     fn mul(self, s: f64) -> Vec2 {
   |                     ^^^ expected `Vec2`, found `f64`
   |
   = note: expected signature `fn(Vec2, Vec2) -> f64`
              found signature `fn(Vec2, f64) -> Vec2`
help: change the parameter type to match the trait
   |
LL |     fn mul(self, s: Vec2) -> Vec2 {
   |                     ~~~~

error[E0053]: method `mul` has an incompatible type for trait
  --> $DIR/wrong-mul-method-signature.rs:52:29
   |
LL |     fn mul(self, s: f64) -> f64 {
   |                             ^^^ expected `i32`, found `f64`
   |
   = note: expected signature `fn(Vec3, _) -> i32`
              found signature `fn(Vec3, _) -> f64`
help: change the output type to match the trait
   |
LL |     fn mul(self, s: f64) -> i32 {
   |                             ~~~

error[E0308]: mismatched types
  --> $DIR/wrong-mul-method-signature.rs:63:45
   |
LL |     let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
   |                   -----------------------   ^^^ expected `Vec2`, found floating-point number
   |                   |
   |                   expected because this is `Vec2`

error[E0308]: mismatched types
  --> $DIR/wrong-mul-method-signature.rs:63:19
   |
LL |     let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Vec2`, found `f64`
   |            |
   |            expected due to this

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.