1 // Test the mechanism for warning about possible missing `self` declarations.
3 fn f8(self, _: usize) -> usize;
4 fn f9(_: usize) -> usize;
8 fn f9(_: usize) -> usize;
11 // Note: this trait is not implemented, but we can't really tell
12 // whether or not an impl would match anyhow without a self
13 // declaration to match against, so we wind up prisizeing it as a
14 // candidate. This seems not unreasonable -- perhaps the user meant to
15 // implement it, after all.
17 fn f9(_: usize) -> usize;
20 impl CtxtFn for usize {
21 fn f8(self, i: usize) -> usize {
25 fn f9(i: usize) -> usize {
30 impl OtherTrait for usize {
31 fn f9(i: usize) -> usize {
36 struct Myisize(isize);
39 fn fff(i: isize) -> isize {
50 impl ManyImplTrait for String {
56 impl ManyImplTrait for usize {}
57 impl ManyImplTrait for isize {}
58 impl ManyImplTrait for char {}
59 impl ManyImplTrait for Myisize {}
61 fn no_param_bound(u: usize, m: Myisize) -> usize {
62 u.f8(42) + u.f9(342) + m.fff(42)
63 //~^ ERROR no method named `f9` found
64 //~| ERROR no method named `fff` found
69 fn param_bound<T: ManyImplTrait>(t: T) -> bool {
71 //~^ ERROR no method named `is_str` found