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

factor out pluralisation remains after #64280 #64342

Open
wants to merge 1 commit into
base: master
from

Conversation

@glorv
Copy link

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

This comment has been minimized.

Copy link
Collaborator

commented Sep 10, 2019

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.

@varkor
Copy link
Member

left a comment

@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;

This comment has been minimized.

Copy link
@varkor

varkor Sep 10, 2019

Member

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

@varkor

This comment has been minimized.

Copy link
Member

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.

Copy link
Collaborator

commented Sep 10, 2019

The job mingw-check of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-09-10T10:35:50.8838504Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-10T10:35:50.9012045Z ##[command]git config gc.auto 0
2019-09-10T10:35:50.9089739Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-10T10:35:50.9146298Z ##[command]git config --get-all http.proxy
2019-09-10T10:35:50.9285705Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64342/merge:refs/remotes/pull/64342/merge
---
2019-09-10T10:45:30.9090967Z configure: build.locked-deps    := True
2019-09-10T10:45:30.9091328Z configure: llvm.ccache          := sccache
2019-09-10T10:45:30.9091770Z configure: build.cargo-native-static := True
2019-09-10T10:45:30.9092043Z configure: dist.missing-tools   := True
2019-09-10T10:45:30.9092265Z configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
2019-09-10T10:45:30.9092346Z configure: writing `config.toml` in current directory
2019-09-10T10:45:30.9092397Z configure: 
2019-09-10T10:45:30.9175612Z configure: run `python /checkout/x.py --help`
2019-09-10T10:45:30.9175709Z configure: 
---
2019-09-10T10:53:43.5318604Z    Compiling serde v1.0.99
2019-09-10T10:53:51.7801482Z    Compiling serde_json v1.0.40
2019-09-10T10:53:53.4685617Z    Compiling rustfix v0.4.6
2019-09-10T10:53:56.8956702Z    Compiling compiletest v0.0.0 (/checkout/src/tools/compiletest)
2019-09-10T10:53:57.0340599Z error: expected `{`, found `,`
2019-09-10T10:53:57.0346510Z      |
2019-09-10T10:53:57.0346510Z      |
2019-09-10T10:53:57.0348234Z 2495 |                             if pluralise!(v.len()),
2019-09-10T10:53:57.0350846Z      |                             --                    ^ expected `{`
2019-09-10T10:53:57.0354350Z      |                             this `if` statement has a condition, but no block
2019-09-10T10:53:57.0355679Z 
2019-09-10T10:53:57.0535534Z error[E0433]: failed to resolve: use of undeclared type or module `syntax`
2019-09-10T10:53:57.0537450Z   --> src/tools/compiletest/src/runtest.rs:39:5
---
2019-09-10T10:53:57.9084967Z == clock drift check ==
2019-09-10T10:53:57.9104010Z   local time: Tue Sep 10 10:53:57 UTC 2019
2019-09-10T10:53:57.9932267Z   network time: Tue, 10 Sep 2019 10:53:57 GMT
2019-09-10T10:53:57.9936191Z == end clock drift check ==
2019-09-10T10:53:59.3037176Z ##[error]Bash exited with code '1'.
2019-09-10T10:53:59.3072895Z ##[section]Starting: Checkout
2019-09-10T10:53:59.3074833Z ==============================================================================
2019-09-10T10:53:59.3074899Z Task         : Get sources
2019-09-10T10:53:59.3074941Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@glorv glorv force-pushed the glorv:master branch from f8b286f to c9fcb5c Sep 11, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Sep 11, 2019

The job mingw-check of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-09-11T01:19:58.3482919Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-11T01:19:58.3707004Z ##[command]git config gc.auto 0
2019-09-11T01:19:58.3786901Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-11T01:19:58.3846351Z ##[command]git config --get-all http.proxy
2019-09-11T01:19:58.3988655Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64342/merge:refs/remotes/pull/64342/merge
---
2019-09-11T01:31:04.4813763Z configure: build.locked-deps    := True
2019-09-11T01:31:04.4813854Z configure: llvm.ccache          := sccache
2019-09-11T01:31:04.4814110Z configure: build.cargo-native-static := True
2019-09-11T01:31:04.4814387Z configure: dist.missing-tools   := True
2019-09-11T01:31:04.4816109Z configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
2019-09-11T01:31:04.4816282Z configure: writing `config.toml` in current directory
2019-09-11T01:31:04.4816333Z configure: 
2019-09-11T01:31:04.4816900Z configure: run `python /checkout/x.py --help`
2019-09-11T01:31:04.4816989Z configure: 
---
2019-09-11T01:41:10.6865104Z    |
2019-09-11T01:41:10.6871514Z 39 | use syntax::errors::pluralise;
2019-09-11T01:41:10.6876480Z    |     ^^^^^^ use of undeclared type or module `syntax`
2019-09-11T01:41:10.6880703Z 
2019-09-11T01:41:10.6994838Z error: cannot find macro `pluralise!` in this scope
2019-09-11T01:41:10.7002861Z      |
2019-09-11T01:41:10.7002861Z      |
2019-09-11T01:41:10.7003551Z 2495 |                             pluralise!(v.len()),
2019-09-11T01:41:10.7005464Z 
2019-09-11T01:41:10.7547335Z error: unused import: `syntax::errors::pluralise`
2019-09-11T01:41:10.7548877Z   --> src/tools/compiletest/src/runtest.rs:39:5
2019-09-11T01:41:10.7549707Z    |
---
2019-09-11T01:41:11.7414451Z == clock drift check ==
2019-09-11T01:41:11.7434036Z   local time: Wed Sep 11 01:41:11 UTC 2019
2019-09-11T01:41:11.8298576Z   network time: Wed, 11 Sep 2019 01:41:11 GMT
2019-09-11T01:41:11.8301247Z == end clock drift check ==
2019-09-11T01:41:13.1783705Z ##[error]Bash exited with code '1'.
2019-09-11T01:41:13.1825292Z ##[section]Starting: Checkout
2019-09-11T01:41:13.1827651Z ==============================================================================
2019-09-11T01:41:13.1827732Z Task         : Get sources
2019-09-11T01:41:13.1827780Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@glorv glorv force-pushed the glorv:master branch 2 times, most recently from 77bc708 to 18b7ef5 Sep 11, 2019

@glorv glorv force-pushed the glorv:master branch from 18b7ef5 to 966fe50 Sep 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.