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

Update tests to remove old numeric constants #78380

Merged
merged 1 commit into from
Nov 29, 2020

Conversation

bstrie
Copy link
Contributor

@bstrie bstrie commented Oct 25, 2020

Part of #68490.

Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros.

For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.

@rust-highfive
Copy link
Collaborator

r? @shepmaster

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2020
@bstrie bstrie added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 25, 2020
fn main() {
match 0usize { //~ERROR non-exhaustive patterns: `_` not covered
0..=MAX => {}
0..=usize::MAX => {}
Copy link
Member

Choose a reason for hiding this comment

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

Wow, what a confusing error.

error[E0004]: non-exhaustive patterns: `_` not covered
 --> src/main.rs:2:11
  |
2 |     match 0usize { //~ERROR non-exhaustive patterns: `_` not covered
  |           ^^^^^^ pattern `_` not covered
  |
  = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
  = note: the matched value is of type `usize`
  = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively

Seems like a strange rule.

@jyn514
Copy link
Member

jyn514 commented Nov 1, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 1, 2020

📌 Commit 7373754f0f3f025d8ae06b9191a2ab01f2bfd3ff has been approved by jyn514

@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 Nov 1, 2020
@bors
Copy link
Contributor

bors commented Nov 1, 2020

⌛ Testing commit 7373754f0f3f025d8ae06b9191a2ab01f2bfd3ff with merge 4b5f7891fc2656006e293377b449a93d820562f5...

@bors
Copy link
Contributor

bors commented Nov 1, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 1, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 1, 2020

Spurious failure.

 warning: spurious network error (1 tries remaining): error inflating zlib stream; class=Zlib (5)
error: failed to get `cc` as a dependency of package `bootstrap v0.0.0 (/checkout/src/bootstrap)`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  error inflating zlib stream; class=Zlib (5)
failed to run: /checkout/obj/build/i686-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked

@bors retry

@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 Nov 1, 2020
@bors
Copy link
Contributor

bors commented Nov 1, 2020

⌛ Testing commit 7373754f0f3f025d8ae06b9191a2ab01f2bfd3ff with merge 35fb0bbeabbb6130a62bc71c4396e5aa470b5adf...

@bors
Copy link
Contributor

bors commented Nov 1, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 1, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 1, 2020

Same issue as before. Going to avoid retrying until the underlying cause is fixed, see https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/pinging.20for.20zlib.20error if you're interested.

@bstrie
Copy link
Contributor Author

bstrie commented Nov 1, 2020

No problem, thanks for your effort!

@shepmaster
Copy link
Member

It's been a while, but now there's a conflict. Probably about time to try again.

r? @jyn514

@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 Nov 18, 2020
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Nov 18, 2020
… r=jyn514

Update tests to remove old numeric constants

Part of rust-lang#68490.

Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros.

For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
@m-ou-se
Copy link
Member

m-ou-se commented Nov 18, 2020

@bors r-

This failed in #79165 on ui/regions/regions-addr-of-upvar-self.rs: https://github.com/rust-lang-ci/rust/runs/1418490059

Looks like this PR updated regions-addr-of-upvar-self.stderr, but should also update regions-addr-of-upvar-self.nll.stderr.

@bors bors 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 Nov 18, 2020
@bors
Copy link
Contributor

bors commented Nov 22, 2020

☔ The latest upstream changes (presumably #79243) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@jyn514
Copy link
Member

jyn514 commented Nov 29, 2020

ping @bstrie - are you planning to work on this in the near future?

@jyn514 jyn514 added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Nov 29, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 29, 2020

FWIW I would be ok with dropping the changes that have run into conflicts and making them later when there are fewer overall changes to make.

Part of rust-lang#68490.

Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros.

For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
@bstrie bstrie force-pushed the rm-old-num-const-from-tests branch from 7edc4f2 to 90a2e5e Compare November 29, 2020 05:56
@bstrie
Copy link
Contributor Author

bstrie commented Nov 29, 2020

Let's find out if I still have these priveliges:

@bors r=@jyn514

@bors
Copy link
Contributor

bors commented Nov 29, 2020

@bstrie: 🔑 Insufficient privileges: Not in reviewers

@bstrie
Copy link
Contributor Author

bstrie commented Nov 29, 2020

@jyn514 All rebased, whenever you have a moment. :)

@jyn514 jyn514 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 Nov 29, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 29, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 29, 2020

📌 Commit 90a2e5e has been approved by jyn514

@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 Nov 29, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 29, 2020

Thanks for working on this!

@bors
Copy link
Contributor

bors commented Nov 29, 2020

⌛ Testing commit 90a2e5e with merge af780e5...

@bors
Copy link
Contributor

bors commented Nov 29, 2020

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing af780e5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 29, 2020
@bors bors merged commit af780e5 into rust-lang:master Nov 29, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants