]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/issue-103474.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / resolve / issue-103474.rs
1 struct S {}
2 impl S {
3     fn first(&self) {}
4
5     fn second(&self) {
6         first()
7         //~^ ERROR cannot find function `first` in this scope
8     }
9
10     fn third(&self) {
11         no_method_err()
12         //~^ ERROR cannot find function `no_method_err` in this scope
13     }
14 }
15
16 // https://github.com/rust-lang/rust/pull/103531#discussion_r1004728080
17 struct Foo {
18     i: i32,
19 }
20
21 impl Foo {
22     fn needs_self() {
23         this.i
24         //~^ ERROR cannot find value `this` in this scope
25     }
26 }
27
28 fn main() {}