-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
factor out pluralisation remains after #64280 #64342
Conversation
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. |
There was a problem hiding this 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.
src/tools/compiletest/src/runtest.rs
Outdated
@@ -36,6 +36,8 @@ use log::*; | |||
use crate::extract_gdb_version; | |||
use crate::is_android_gdb_target; | |||
|
|||
use syntax::errors::pluralise; |
There was a problem hiding this comment.
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.
r? @varkor |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
18b7ef5
to
966fe50
Compare
Ping from triage, any updates? @varkor |
@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. |
This comment has been minimized.
This comment has been minimized.
70c695a
to
20dc4e0
Compare
This comment has been minimized.
This comment has been minimized.
7dd1570
to
93d8eb0
Compare
This comment has been minimized.
This comment has been minimized.
📌 Commit 1ab5593 has been approved by |
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
Rollup of 8 pull requests Successful merges: - #64136 (Document From trait for LhsExpr in parser) - #64342 (factor out pluralisation remains after #64280) - #64387 (Fix redundant semicolon lint interaction with proc macro attributes) - #64498 (When possible point at argument causing item obligation failure) - #64615 (rustbuild: Turn down compression on exe installers) - #64617 (rustbuild: Turn down compression on msi installers) - #64618 (rustbuild: Improve output of `dist` step) - #64621 (Add Compatibility Notes to RELEASES.md for 1.38.0) Failed merges: r? @ghost
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
factor out pluralisation remains after rust-lang#64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) 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 rust-lang#64238.
Rollup of 9 pull requests Successful merges: - #64010 (Stabilize `param_attrs` in Rust 1.39.0) - #64136 (Document From trait for LhsExpr in parser) - #64342 (factor out pluralisation remains after #64280) - #64347 (Add long error explanation for E0312) - #64621 (Add Compatibility Notes to RELEASES.md for 1.38.0) - #64632 (remove the extra comma after the match arm) - #64640 (No home directory on vxWorks) - #64641 (Exempt extern "Rust" from improper_ctypes) - #64642 (Fix the span used to suggest avoiding for-loop moves) Failed merges: r? @ghost
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.