Skip to content

Fix variable name in E0502 double borrow error #51651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

spastorino
Copy link
Member

Closes #51268

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 20, 2018
@rust-lang rust-lang deleted a comment from rust-highfive Jun 20, 2018
@spastorino spastorino force-pushed the fix_var_name_in_e0502 branch from aaa07b5 to 68b477e Compare June 20, 2018 04:53
impl Foo {
fn foo(&mut self) {
self.thing.bar(|| {
//~^ ERROR cannot borrow `self.thing` as mutable because it is also borrowed as immutable [E0502]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are still checking for self.thing, which is probably also why the tests are failing ;)

Copy link
Contributor

@nikomatsakis nikomatsakis Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that part is correct -- the main error still talks about self.thing.

@nikomatsakis
Copy link
Contributor

This is the relevent part of the log:

[00:43:35] ---- [ui] ui/nll/issue-51268.rs stdout ----
[00:43:35] diff of stderr:
[00:43:35] 
[00:43:35] 1	error[E0502]: cannot borrow `self.thing` as mutable because it is also borrowed as immutable
[00:43:35] -	  --> $DIR/issue-51268.rs:26:9
[00:43:35] +	  --> $DIR/issue-51268.rs:28:9
[00:43:35] 3	   |
[00:43:35] 4	LL |            self.thing.bar(|| {
[00:43:35] 5	   |            ^              -- immutable borrow occurs here
[00:43:35] 
[00:43:35] 

(cc @TimNN -- jfyi the bot failed to extract this particular error)

@rust-lang rust-lang deleted a comment from rust-highfive Jun 20, 2018
@spastorino spastorino force-pushed the fix_var_name_in_e0502 branch from 68b477e to 3d31e5f Compare June 20, 2018 12:05
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 20, 2018

📌 Commit 3d31e5f has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2018
@bors
Copy link
Collaborator

bors commented Jun 20, 2018

⌛ Testing commit 3d31e5f with merge 637fd2e...

bors added a commit that referenced this pull request Jun 20, 2018
Fix variable name in E0502 double borrow error

Closes #51268

r? @nikomatsakis
@bors
Copy link
Collaborator

bors commented Jun 20, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 637fd2e to master...

@bors bors merged commit 3d31e5f into rust-lang:master Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants