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

Move some test-only code to test files #83197

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Mar 16, 2021

Split out from #83185.

@jyn514 jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 16, 2021
@rust-highfive
Copy link
Collaborator

r? @lcnr

(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 Mar 16, 2021
@jyn514 jyn514 mentioned this pull request Mar 16, 2021
6 tasks
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

It's preferable to move test-only code to tests.rs files instead of adding #[cfg(test)] attributes.

@jyn514 jyn514 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 16, 2021
@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 Mar 17, 2021
@jyn514 jyn514 changed the title Make some dead code cfg(test) Move some test-only code to test files Mar 17, 2021
This also relaxes the bounds on some structs and moves them to the impl
block instead.
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 18, 2021

📌 Commit 620ecc0 has been approved by joshtriplett

@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 Mar 18, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 18, 2021
…iplett

Move some test-only code to test files

Split out from rust-lang#83185.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 18, 2021
…iplett

Move some test-only code to test files

Split out from rust-lang#83185.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 19, 2021
…iplett

Move some test-only code to test files

Split out from rust-lang#83185.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 19, 2021
…iplett

Move some test-only code to test files

Split out from rust-lang#83185.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 19, 2021
…iplett

Move some test-only code to test files

Split out from rust-lang#83185.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 19, 2021
Rollup of 11 pull requests

Successful merges:

 - rust-lang#82500 (Reuse `std::sys::unsupported::pipe` on `hermit`)
 - rust-lang#82759 (Remove unwrap_none/expect_none from compiler/.)
 - rust-lang#82846 (rustdoc: allow list syntax for #[doc(alias)] attributes)
 - rust-lang#82892 (Clarify docs for Read::read's return value)
 - rust-lang#83179 (Extend `proc_macro_back_compat` lint to `actix-web`)
 - rust-lang#83197 (Move some test-only code to test files)
 - rust-lang#83208 (Fix gitattibutes for old git versions)
 - rust-lang#83215 (Deprecate std::os::haiku::raw, which accidentally wasn't deprecated)
 - rust-lang#83230 (Remove unnecessary `forward_inner_docs` hack)
 - rust-lang#83236 (Upgrade memmap to memmap2)
 - rust-lang#83270 (Fix typo/inaccuracy in the documentation of Iterator::skip_while)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 37b7031 into rust-lang:master Mar 19, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 19, 2021
@jyn514 jyn514 deleted the cfg-test-dead-code branch March 19, 2021 18:29
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 29, 2021
Remove (lots of) dead code

Builds on
- [ ] rust-lang#83161
- [x] rust-lang#83230
- [x] rust-lang#83197.

Found with https://github.com/est31/warnalyzer.
See rust-lang#77739 for a similar change in the past.

Dubious changes:
- Maybe some of the dead code in rustc_data_structures should be kept, in case someone wants to use it in the future?

TODO:
- [ ] check if any of the comments on the deleted code should be kept.
- [x] update the compiler documentation; right now it fails to build
- [x] finish moving `cfg(test)` changes into rust-lang#83197

cc `@est31`
spikespaz pushed a commit to spikespaz/dotwalk-rs that referenced this pull request Aug 29, 2024
Remove (lots of) dead code

Builds on
- [ ] rust-lang/rust#83161
- [x] rust-lang/rust#83230
- [x] rust-lang/rust#83197.

Found with https://github.com/est31/warnalyzer.
See rust-lang/rust#77739 for a similar change in the past.

Dubious changes:
- Maybe some of the dead code in rustc_data_structures should be kept, in case someone wants to use it in the future?

TODO:
- [ ] check if any of the comments on the deleted code should be kept.
- [x] update the compiler documentation; right now it fails to build
- [x] finish moving `cfg(test)` changes into rust-lang/rust#83197

cc `@est31`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. 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.

8 participants