]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/suggest-methods.rs
Rollup merge of #100953 - joshtriplett:write-docs, r=Mark-Simulacrum
[rust.git] / src / test / ui / suggestions / suggest-methods.rs
1 struct Foo;
2
3 impl Foo {
4     fn bar(self) {}
5     fn baz(&self, x: f64) {}
6 }
7
8 trait FooT {
9     fn bag(&self);
10 }
11
12 impl FooT for Foo {
13     fn bag(&self) {}
14 }
15
16 fn main() {
17     let f = Foo;
18     f.bat(1.0); //~ ERROR no method named
19
20     let s = "foo".to_string();
21     let _ = s.is_emtpy(); //~ ERROR no method named
22
23     // Generates a warning for `count_zeros()`. `count_ones()` is also a close
24     // match, but the former is closer.
25     let _ = 63u32.count_eos(); //~ ERROR no method named
26
27     // Does not generate a warning
28     let _ = 63u32.count_o(); //~ ERROR no method named
29
30 }