fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.0 KiB38 linesraw
1error[E0425]: cannot find function `cmp` in this scope
2  --> $DIR/fn-to-method.rs:8:13
3   |
4LL |     let x = cmp(&1, &2);
5   |             ^^^ not found in this scope
6   |
7help: use the `.` operator to call the method `Ord::cmp` on `&{integer}`
8   |
9LL |     let x = (&1).cmp(&2);
10   |             ~  ~~~~~~~~~
11
12error[E0425]: cannot find function `len` in this scope
13  --> $DIR/fn-to-method.rs:12:13
14   |
15LL |     let y = len([1, 2, 3]);
16   |             ^^^ not found in this scope
17   |
18help: use the `.` operator to call the method `len` on `&[{integer}]`
19   |
20LL -     let y = len([1, 2, 3]);
21LL +     let y = [1, 2, 3].len();
22   |
23
24error[E0425]: cannot find function `bar` in this scope
25  --> $DIR/fn-to-method.rs:16:13
26   |
27LL |     let z = bar(Foo);
28   |             ^^^ not found in this scope
29   |
30help: use the `.` operator to call the method `bar` on `Foo`
31   |
32LL -     let z = bar(Foo);
33LL +     let z = Foo.bar();
34   |
35
36error: aborting due to 3 previous errors
37
38For more information about this error, try `rustc --explain E0425`.