Skip to content

Conversation

CDirkx
Copy link
Contributor

@CDirkx CDirkx commented Sep 3, 2020

These tests are about the standard library, not the compiler itself, thus should live in library, see #76268.

@rust-highfive
Copy link
Contributor

r? @kennytm

(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 Sep 3, 2020
@CDirkx
Copy link
Contributor Author

CDirkx commented Sep 3, 2020

Currently implemented as two big tests: ipv4_const and ipv6_const, although I could split the individual tests out.
However, the point of this test is to check that the API of Ipv4Addr and Ipv6Addr is usable in a const context. The only thing really being tested here is that the consts compile, to the point that technically all the asserts could even be removed.

@CDirkx
Copy link
Contributor Author

CDirkx commented Sep 3, 2020

r? @matklad

@rust-highfive rust-highfive assigned matklad and unassigned kennytm Sep 3, 2020
@matklad
Copy link
Contributor

matklad commented Sep 3, 2020

Rather than adding a new integration test in src/test directory, let’s add the test to existing unit-test module: https://github.com/rust-lang/rust/blob/2906a60a4f6b417abd487f0d8c917532911fdd20/library/std/src/net/ip/tests.rs

Integration tests have essentially the same problem as run-pass tests — each integration test is a separately linked and run binary, so many integration tests = slow.

@CDirkx
Copy link
Contributor Author

CDirkx commented Sep 3, 2020

Ah I see, I moved the tests.

I still kept the tests as ipv4_const and ipv6_const instead of integrating the const checks into the various other tests, to have a single place where the constness of the public API is asserted.

@matklad
Copy link
Contributor

matklad commented Sep 3, 2020

LGTM!

Could you squash the commits to one here as well?

@bors delegate=CDirkx

@bors
Copy link
Collaborator

bors commented Sep 3, 2020

✌️ @CDirkx can now approve this pull request

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
@CDirkx CDirkx changed the title Move Ipv4Addr and Ipv6Addr const tests to library\std\tests Make Ipv4Addr and Ipv6Addr const tests unit tests under library Sep 3, 2020
@matklad
Copy link
Contributor

matklad commented Sep 3, 2020

@bors r+ rollup

Thanks!

@bors
Copy link
Collaborator

bors commented Sep 3, 2020

📌 Commit a2e077e has been approved by matklad

@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 3, 2020
@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 3, 2020
@CDirkx
Copy link
Contributor Author

CDirkx commented Sep 3, 2020

Alright, I'll update the tests in the other PRs similarly

matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
matklad added a commit to matklad/rust that referenced this pull request Sep 4, 2020
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 6, 2020
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`

These tests are about the standard library, not the compiler itself, thus should live in `library`, see rust-lang#76268.
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 7, 2020
Rollup of 18 pull requests

Successful merges:

 - rust-lang#76273 (Move some Vec UI tests into alloc unit tests)
 - rust-lang#76274 (Allow try blocks as the argument to return expressions)
 - rust-lang#76287 (Remove an unnecessary allowed lint)
 - rust-lang#76293 (Implementation of incompatible features error)
 - rust-lang#76299 (Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`)
 - rust-lang#76302 (Address review comments on `Peekable::next_if`)
 - rust-lang#76303 (Link to `#capacity-and-reallocation` when using with_capacity)
 - rust-lang#76305 (Move various ui const tests to `library`)
 - rust-lang#76309 (Indent a note to make folding work nicer)
 - rust-lang#76312 (time.rs: Make spelling of "Darwin" consistent)
 - rust-lang#76318 (Use ops::ControlFlow in rustc_data_structures::graph::iterate)
 - rust-lang#76324 (Move Vec slice UI tests in library)
 - rust-lang#76338 (add some intra-doc links to `Iterator`)
 - rust-lang#76340 (Remove unused duplicated `trivial_dropck_outlives`)
 - rust-lang#76344 (Improve docs for `std::env::args()`)
 - rust-lang#76346 (Docs: nlink example typo)
 - rust-lang#76358 (Minor grammar fix in doc comment for soft-deprecated methods)
 - rust-lang#76364 (Disable atomics on avr target.)

Failed merges:

 - rust-lang#76304 (Make delegation methods of `std::net::IpAddr` unstably const)

r? @ghost
@bors bors merged commit 2c62189 into rust-lang:master Sep 7, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 7, 2020
@CDirkx CDirkx deleted the ip-tests branch October 17, 2020 13:41
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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API 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