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

Add reset_err_count() to errors::Handler #43778

Merged
merged 1 commit into from
Aug 30, 2017

Conversation

topecongiro
Copy link
Contributor

The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc rust-lang/rustfmt#1742).
r? @nrc

@aidanhs
Copy link
Member

aidanhs commented Aug 10, 2017

Thanks for the PR @topecongiro! We'll check in now and again to make sure @nrc or another reviewer gets to this soon.

@alexcrichton alexcrichton added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2017
@carols10cents
Copy link
Member

friendly ping @nrc !

1 similar comment
@arielb1
Copy link
Contributor

arielb1 commented Aug 22, 2017

friendly ping @nrc !

@nrc
Copy link
Member

nrc commented Aug 22, 2017

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 22, 2017

📌 Commit a326948 has been approved by nrc

@nrc nrc 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 Aug 22, 2017
@arielb1
Copy link
Contributor

arielb1 commented Aug 22, 2017

rustc relies on err_count being non-zero if an error happened to avoid ICEs. Could you at least add a comment that this method is dangerous @topecongiro?

@bors r-

@nrc
Copy link
Member

nrc commented Aug 22, 2017

@bors r-

@@ -303,6 +303,10 @@ impl Handler {
self.continue_after_error.set(continue_after_error);
}

pub fn reset_err_count(&self) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment to this stating that it should not be called in rustc, only by tools (it would break the compiler's error handling)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arielb1 @nrc Thanks for comments! I will update shortly.

@arielb1 arielb1 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2017
The motivation here is to allow rustfmt to recover from parse errors
after failing to parse macros.
@topecongiro
Copy link
Contributor Author

Updated & rebased.

@carols10cents carols10cents added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 28, 2017
@carols10cents
Copy link
Member

Looks like this is back in your court @nrc !

@arielb1
Copy link
Contributor

arielb1 commented Aug 29, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Aug 29, 2017

📌 Commit 601e3da has been approved by arielb1

@arielb1
Copy link
Contributor

arielb1 commented Aug 29, 2017

@bors rollup

@arielb1 arielb1 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 Aug 29, 2017
arielb1 pushed a commit to arielb1/rust that referenced this pull request Aug 29, 2017
…, r=arielb1

Add reset_err_count() to errors::Handler

The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc rust-lang/rustfmt#1742).
r? @nrc
arielb1 pushed a commit to arielb1/rust that referenced this pull request Aug 29, 2017
…, r=arielb1

Add reset_err_count() to errors::Handler

The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc rust-lang/rustfmt#1742).
r? @nrc
bors added a commit that referenced this pull request Aug 29, 2017
Rollup of 12 pull requests

- Successful merges: #43705, #43778, #43918, #44076, #44117, #44121, #44126, #44134, #44135, #44141, #44144, #44158
- Failed merges:
@bors bors merged commit 601e3da into rust-lang:master Aug 30, 2017
@topecongiro
Copy link
Contributor Author

Thank you!

@topecongiro topecongiro deleted the handler-reset-err-count branch August 30, 2017 10:59
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.

7 participants