Skip to content

Commit

Permalink
update ui test for suggest-self
Browse files Browse the repository at this point in the history
  • Loading branch information
csmoe committed Oct 1, 2018
1 parent 99edcd4 commit 912691b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/test/ui/self/suggest-self.rs
Expand Up @@ -13,6 +13,20 @@ struct Foo {
}

impl Foo {
fn this1(&self) -> i32 {
let this = self;
let a = 1;
this.x
}

fn this2(&self) -> i32 {
let a = Foo {
x: 2
};
let this = a;
this.x
}

fn foo(&self) -> i32 {
this.x
//~^ ERROR cannot find value `this` in this scope
Expand All @@ -25,7 +39,7 @@ impl Foo {

fn baz(&self) -> i32 {
my.bar()
//~^ ERROR cannot find value `this` in this scope
//~^ ERROR cannot find value `my` in this scope
}
}

Expand Down
30 changes: 30 additions & 0 deletions src/test/ui/self/suggest-self.stderr
@@ -0,0 +1,30 @@
error[E0425]: cannot find value `this` in this scope
--> $DIR/suggest-self.rs:31:9
|
LL | this.x
| ^^^^
| |
| not found in this scope
| help: do you mean: `self`

error[E0425]: cannot find value `this` in this scope
--> $DIR/suggest-self.rs:36:9
|
LL | this.foo()
| ^^^^
| |
| not found in this scope
| help: do you mean: `self`

error[E0425]: cannot find value `my` in this scope
--> $DIR/suggest-self.rs:41:9
|
LL | my.bar()
| ^^
| |
| not found in this scope
| help: do you mean: `self`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0425`.

0 comments on commit 912691b

Please sign in to comment.