Skip to content
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

Move REGISTERED_DIAGNOSTICS to a ParseSess field #48808

Merged
merged 2 commits into from
Mar 9, 2018
Merged

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Mar 7, 2018

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 7, 2018
Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

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

Looks good to me. However, I think it would really be an improvement if we had a Lock::with() method as that would encourage making locking ranges more visible and explicit.

));
}
});
let mut diagnostics = ecx.parse_sess.registered_diagnostics.lock();
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a with method to Lock? That would make it clearer in many cases whether the lock is held until the end of the block intentionally or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's probably not a bad idea. with sounds a little innocent for a lock though.

Copy link
Member

Choose a reason for hiding this comment

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

with_lock() maybe?

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 8, 2018

I added methods to lock in a closure.

@michaelwoerister
Copy link
Member

👍

@bors r+

@bors
Copy link
Contributor

bors commented Mar 8, 2018

📌 Commit 728c16c has been approved by michaelwoerister

@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 Mar 8, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 8, 2018
Move REGISTERED_DIAGNOSTICS to a ParseSess field

r? @michaelwoerister
bors added a commit that referenced this pull request Mar 8, 2018
Rollup of 7 pull requests

- Successful merges: #48292, #48682, #48699, #48738, #48752, #48789, #48808
- Failed merges:
@bors bors merged commit 728c16c into rust-lang:master Mar 9, 2018
@Zoxc Zoxc deleted the reg-diag branch March 14, 2018 16:38
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.

4 participants