Skip to content

std: Minor cleanup to libtest #36981

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

Merged
merged 1 commit into from
Oct 7, 2016

Conversation

alexcrichton
Copy link
Member

  • Don't spawn two threads for all tests, just one now that catch_unwind is
    stable.
  • Remove usage of the unstable box keyword
  • Remove usage of the unstable FnBox trait

@rust-highfive
Copy link
Contributor

r? @sfackler

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

@sfackler
Copy link
Member

sfackler commented Oct 5, 2016

r=me but travis is failing

@alexcrichton alexcrichton force-pushed the catch-unwind-for-tests branch from 2b7da0a to 4f1eccc Compare October 5, 2016 17:31
@alexcrichton
Copy link
Member Author

@bors: r=sfackler

@bors
Copy link
Collaborator

bors commented Oct 5, 2016

📌 Commit 4f1eccc has been approved by sfackler

@TimNN
Copy link
Contributor

TimNN commented Oct 5, 2016

Still fails travis:

error[E0281]: type mismatch: the type `[closure@src/tools/compiletest/src/main.rs:467:30: 469:6 config:_, testpaths:_]` implements the trait `std::ops::FnOnce<()>`, but the trait `std::ops::FnOnce<((),)>` is required (expected tuple, found ())
   --> src/tools/compiletest/src/main.rs:467:21
    |
467 |     test::DynTestFn(Box::new(move || {
    |                     ^
    |
    = note: required because of the requirements on the impl of `test::FnBox<()>` for `[closure@src/tools/compiletest/src/main.rs:467:30: 469:6 config:_, testpaths:_]`
    = note: required for the cast to the object type `test::FnBox<()> + 'static`

error: aborting due to previous error

@alexcrichton alexcrichton force-pushed the catch-unwind-for-tests branch from 4f1eccc to e18b415 Compare October 5, 2016 18:41
@alexcrichton
Copy link
Member Author

@bors: r=sfackler

@bors
Copy link
Collaborator

bors commented Oct 5, 2016

📌 Commit e18b415 has been approved by sfackler

@alexcrichton alexcrichton force-pushed the catch-unwind-for-tests branch from e18b415 to eebe9a2 Compare October 5, 2016 22:22
@alexcrichton
Copy link
Member Author

@bors: r=sfackler

@bors
Copy link
Collaborator

bors commented Oct 5, 2016

📌 Commit eebe9a2 has been approved by sfackler

@sophiajt
Copy link
Contributor

sophiajt commented Oct 6, 2016

Seeing a fair number of errors like (which seem legit):

   Compiling test v0.0.0 (file:///build/src/libtest)
error[E0281]: type mismatch: the type `[closure@src/libtest/lib.rs:1499:40: 1499:51]` implements the trait `std::ops::FnOnce<()>`, but the trait `std::ops::FnOnce<((),)>` is required (expected tuple, found ())
    --> src/libtest/lib.rs:1499:31
     |
1499 |             testfn: DynTestFn(Box::new(move || f())),
     |                               ^^^^^^^^^^^^^^^^^^^^^
     |
     = note: required because of the requirements on the impl of `FnBox<()>` for `[closure@src/libtest/lib.rs:1499:40: 1499:51]`
     = note: required for the cast to the object type `FnBox<()> + 'static`
error[E0281]: type mismatch: the type `[closure@src/libtest/lib.rs:1516:40: 1516:51]` implements the trait `std::ops::FnOnce<()>`, but the trait `std::ops::FnOnce<((),)>` is required (expected tuple, found ())
    --> src/libtest/lib.rs:1516:31
     |
1516 |             testfn: DynTestFn(Box::new(move || f())),
     |                               ^^^^^^^^^^^^^^^^^^^^^
     |
     = note: required because of the requirements on the impl of `FnBox<()>` for `[closure@src/libtest/lib.rs:1516:40: 1516:51]`
     = note: required for the cast to the object type `FnBox<()> + 'static`
error[E0281]: type mismatch: the type `[closure@src/libtest/lib.rs:1535:40: 1535:51]` implements the trait `std::ops::FnOnce<()>`, but the trait `std::ops::FnOnce<((),)>` is required (expected tuple, found ())
    --> src/libtest/lib.rs:1535:31
     |
1535 |             testfn: DynTestFn(Box::new(move || f())),
     |                               ^^^^^^^^^^^^^^^^^^^^^
     |
     = note: required because of the requirements on the impl of `FnBox<()>` for `[closure@src/libtest/lib.rs:1535:40: 1535:51]`
     = note: required for the cast to the object type `FnBox<()> + 'static`

* Don't spawn two threads for all tests, just one now that `catch_unwind` is
  stable.
* Remove usage of the unstable `box` keyword
* Remove usage of the unstable `FnBox` trait
@alexcrichton alexcrichton force-pushed the catch-unwind-for-tests branch from eebe9a2 to 0714024 Compare October 6, 2016 16:02
@alexcrichton
Copy link
Member Author

@bors: r=sfackler

@bors
Copy link
Collaborator

bors commented Oct 6, 2016

📌 Commit 0714024 has been approved by sfackler

@bors
Copy link
Collaborator

bors commented Oct 7, 2016

⌛ Testing commit 0714024 with merge 6e8f92f...

bors added a commit that referenced this pull request Oct 7, 2016
std: Minor cleanup to libtest

* Don't spawn two threads for all tests, just one now that `catch_unwind` is
  stable.
* Remove usage of the unstable `box` keyword
* Remove usage of the unstable `FnBox` trait
@bors bors merged commit 0714024 into rust-lang:master Oct 7, 2016
@alexcrichton alexcrichton deleted the catch-unwind-for-tests branch October 7, 2016 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants