]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/fn-to-method.rs
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
[rust.git] / tests / ui / suggestions / fn-to-method.rs
1 struct Foo;
2
3 impl Foo {
4     fn bar(self) {}
5 }
6
7 fn main() {
8     let x = cmp(&1, &2);
9     //~^ ERROR cannot find function `cmp` in this scope
10     //~| HELP use the `.` operator to call the method `Ord::cmp` on `&{integer}`
11
12     let y = len([1, 2, 3]);
13     //~^ ERROR cannot find function `len` in this scope
14     //~| HELP use the `.` operator to call the method `len` on `&[{integer}]`
15
16     let z = bar(Foo);
17     //~^ ERROR cannot find function `bar` in this scope
18     //~| HELP use the `.` operator to call the method `bar` on `Foo`
19 }