2023-12-01 08:17:31 -06:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
|
|
struct A {}
|
|
|
|
|
|
|
|
impl A {
|
|
|
|
fn hello(_a: i32) {}
|
|
|
|
fn test(_a: Self, _b: i32) {}
|
|
|
|
}
|
|
|
|
|
2023-12-09 03:49:40 -06:00
|
|
|
struct B<T> {
|
|
|
|
_b: T
|
|
|
|
}
|
|
|
|
impl<T> B<T> {
|
|
|
|
fn hello(_a: i32) {}
|
|
|
|
fn test(_a: Self, _b: i32) {}
|
|
|
|
}
|
|
|
|
|
2023-12-01 08:17:31 -06:00
|
|
|
fn main() {
|
|
|
|
let _a = A {};
|
|
|
|
_a.hello(1);
|
|
|
|
//~^ ERROR no method named `hello` found
|
|
|
|
_a.test(1);
|
|
|
|
//~^ ERROR no method named `test` found
|
2023-12-09 03:49:40 -06:00
|
|
|
|
|
|
|
let _b = B {_b: ""};
|
|
|
|
_b.hello(1);
|
|
|
|
//~^ ERROR no method named `hello` found
|
|
|
|
_b.test(1);
|
|
|
|
//~^ ERROR no method named `test` found
|
2023-12-01 08:17:31 -06:00
|
|
|
}
|