Skip to content

factor out pluralisation remains after #64280 #64342

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
Sep 21, 2019
Merged

Conversation

glorv
Copy link
Contributor

@glorv glorv commented Sep 10, 2019

there are two case that doesn't not match the original macro pattern at here and here as the provided param is already a bool or the check condition is not x != 1, so I change the macro accept a boolean expr instead of number to fit all the cases.

@Centril please review

Fixes #64238.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

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

@varkor varkor left a comment

Choose a reason for hiding this comment

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

@glorv: thanks for the pull request! Instead of adding another variant to the macro, I would instead use the original macro and refactor the methods that have a plural: bool. E.g.
https://github.com/rust-lang/rust/blob/5608ea6277e6ab5421318068c47647a289d83d82/src/librustc_lint/unused.rs#L254
could pass len instead of true and then pluralise! could be used as normal.

@@ -36,6 +36,8 @@ use log::*;
use crate::extract_gdb_version;
use crate::is_android_gdb_target;

use syntax::errors::pluralise;
Copy link
Member

Choose a reason for hiding this comment

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

You can't use syntax here: I might just leave this one as is.

@varkor
Copy link
Member

varkor commented Sep 10, 2019

r? @varkor

@rust-highfive rust-highfive assigned varkor and unassigned estebank Sep 10, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@glorv glorv force-pushed the master branch 3 times, most recently from 18b7ef5 to 966fe50 Compare September 11, 2019 02:59
@Alexendoo
Copy link
Member

Ping from triage, any updates? @varkor

@varkor
Copy link
Member

varkor commented Sep 18, 2019

@glorv: sorry, I didn't notice that you had pushed new changes. I think you want to keep the macro definition as-is: you should just be passing an integer to it. You'll just need to do some refactoring around the locations where there's a boolean value.

@glorv
Copy link
Contributor Author

glorv commented Sep 19, 2019

@varkor @estebank thanks for the review and comments. I change the macro back to the origin format and refactor the effected code, please have another review about that.

@rust-highfive

This comment has been minimized.

@glorv glorv force-pushed the master branch 5 times, most recently from 70c695a to 20dc4e0 Compare September 19, 2019 07:13
@rust-highfive

This comment has been minimized.

@glorv glorv force-pushed the master branch 2 times, most recently from 7dd1570 to 93d8eb0 Compare September 19, 2019 16:02
@rust-highfive

This comment has been minimized.

@varkor
Copy link
Member

varkor commented Sep 19, 2019

@glorv: this all looks good to me! Thanks for your patience!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 19, 2019

📌 Commit 1ab5593 has been approved by varkor

@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 Sep 19, 2019
This was referenced Sep 20, 2019
This was referenced Sep 21, 2019
@bors bors merged commit 1ab5593 into rust-lang:master Sep 21, 2019
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.

Factor out pluralisation checks in diagnostics
6 participants