2022-04-28 15:54:28 +08:00
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
fn foo() {}
|
|
|
|
|
|
|
|
fn bar(&self) {}
|
|
|
|
|
|
|
|
fn baz(a: u8, b: u8) {}
|
|
|
|
|
|
|
|
fn b() {
|
|
|
|
fn c() {
|
|
|
|
foo(); //~ ERROR cannot find function `foo` in this scope
|
|
|
|
}
|
|
|
|
foo(); //~ ERROR cannot find function `foo` in this scope
|
|
|
|
bar(); //~ ERROR cannot find function `bar` in this scope
|
|
|
|
baz(2, 3); //~ ERROR cannot find function `baz` in this scope
|
|
|
|
}
|
2023-09-23 09:34:50 +08:00
|
|
|
fn d(&self) {
|
|
|
|
fn c() {
|
|
|
|
foo(); //~ ERROR cannot find function `foo` in this scope
|
|
|
|
}
|
|
|
|
foo(); //~ ERROR cannot find function `foo` in this scope
|
|
|
|
bar(); //~ ERROR cannot find function `bar` in this scope
|
|
|
|
baz(2, 3); //~ ERROR cannot find function `baz` in this scope
|
|
|
|
}
|
2022-04-28 15:54:28 +08:00
|
|
|
}
|