]> git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/assoc_fn_without_self.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / suggestions / assoc_fn_without_self.rs
1 fn main() {}
2
3 struct S;
4
5 impl S {
6 fn foo() {}
7
8 fn bar(&self) {}
9
10 fn baz(a: u8, b: u8) {}
11
12 fn b() {
13 fn c() {
14 foo(); //~ ERROR cannot find function `foo` in this scope
15 }
16 foo(); //~ ERROR cannot find function `foo` in this scope
17 bar(); //~ ERROR cannot find function `bar` in this scope
18 baz(2, 3); //~ ERROR cannot find function `baz` in this scope
19 }
20 fn d(&self) {
21 fn c() {
22 foo(); //~ ERROR cannot find function `foo` in this scope
23 }
24 foo(); //~ ERROR cannot find function `foo` in this scope
25 bar(); //~ ERROR cannot find function `bar` in this scope
26 baz(2, 3); //~ ERROR cannot find function `baz` in this scope
27 }
28 }