File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,16 @@ impl S {
1313 }
1414}
1515
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+
1628fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0425]: cannot find value `this` in this scope
2+ --> $DIR/issue-103474.rs:23:9
3+ |
4+ LL | this.i
5+ | ^^^^ not found in this scope
6+ |
7+ help: you might have meant to use `self` here instead
8+ |
9+ LL | self.i
10+ | ~~~~
11+ help: if you meant to use `self`, you are also missing a `self` receiver argument
12+ |
13+ LL | fn needs_self(&self) {
14+ | +++++
15+
116error[E0425]: cannot find function `first` in this scope
217 --> $DIR/issue-103474.rs:6:9
318 |
@@ -15,6 +30,6 @@ error[E0425]: cannot find function `no_method_err` in this scope
1530LL | no_method_err()
1631 | ^^^^^^^^^^^^^ not found in this scope
1732
18- error: aborting due to 2 previous errors
33+ error: aborting due to 3 previous errors
1934
2035For more information about this error, try `rustc --explain E0425`.
You can’t perform that action at this time.
0 commit comments