File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,16 @@ impl S {
13
13
}
14
14
}
15
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
+
16
28
fn 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
+
1
16
error[E0425]: cannot find function `first` in this scope
2
17
--> $DIR/issue-103474.rs:6:9
3
18
|
@@ -15,6 +30,6 @@ error[E0425]: cannot find function `no_method_err` in this scope
15
30
LL | no_method_err()
16
31
| ^^^^^^^^^^^^^ not found in this scope
17
32
18
- error: aborting due to 2 previous errors
33
+ error: aborting due to 3 previous errors
19
34
20
35
For more information about this error, try `rustc --explain E0425`.
You can’t perform that action at this time.
0 commit comments