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

Rollup of 11 pull requests #79104

Merged
merged 46 commits into from
Nov 17, 2020
Merged

Rollup of 11 pull requests #79104

merged 46 commits into from
Nov 17, 2020

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Nov 16, 2020

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Jacob Hughes and others added 30 commits October 8, 2020 00:39
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
Co-authored-by: Camelid <camelidcamel@gmail.com>
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Adds structural match tests for all range types.

Note: also adds the otherwise unrelated test `test_range_to_inclusive` for completeness
It was only ever used with Vec<u8> anyway. This simplifies some things.

- It no longer needs to be flushed, because that's a no-op anyway for
  a Vec<u8>.

- Writing to a Vec<u8> never fails.

- No #[cfg(test)] code is needed anymore to use `realstd` instead of
  `std`, because Vec comes from alloc, not std (like Write).
There were no use cases for setting them separately.
Merging them simplifies some things.
This gives warnings about dead code.
…odrAus

Simplify output capturing

This is a sequence of incremental improvements to the unstable/internal `set_panic` and `set_print` mechanism used by the `test` crate:

1. Remove the `LocalOutput` trait and use `Arc<Mutex<dyn Write>>` instead of `Box<dyn LocalOutput>`. In practice, all implementations of `LocalOutput` were just `Arc<Mutex<..>>`. This simplifies some logic and removes all custom `Sink` implementations such as `library/test/src/helpers/sink.rs`. Also removes a layer of indirection, as the outermost `Box` is now gone. It also means that locking now happens per `write_fmt`, not per individual `write` within. (So `"{} {}\n"` now results in one `lock()`, not four or more.)

2. Since in all cases the `dyn Write`s were just `Vec<u8>`s, replace the type with `Arc<Mutex<Vec<u8>>>`. This simplifies things more, as error handling and flushing can be removed now. This also removes the hack needed in the default panic handler to make this work with `::realstd`, as (unlike `Write`) `Vec<u8>` is from `alloc`, not `std`.

3. Replace the `RefCell`s by regular `Cell`s. The `RefCell`s were mostly used as `mem::replace(&mut *cell.borrow_mut(), something)`, which is just `Cell::replace`. This removes an unecessary bookkeeping and makes the code a bit easier to read.

4. Merge `set_panic` and `set_print` into a single `set_output_capture`. Neither the test crate nor rustc (the only users of this feature) have a use for using these separately. Merging them simplifies things even more. This uses a new function name and feature name, to make it clearer this is internal and not supposed to be used by other crates.

Might be easier to review per commit.
Remove unneeded lifetimes in array/mod.rs
…r=Mark-Simulacrum

BTreeMap: test chaotic ordering & other bits & bobs

r? `@Mark-Simulacrum`
improve type const mismatch errors

Doesn't completely remove `check_generic_arg_count` as that would have required some more complex changes but
instead checks type and const params in only one step. Also moved the help added by `@JulianKnodt` in rust-lang#75611 to `generic_arg_mismatch_err`.

r? `@varkor` cc `@petrochenkov`
Make all rustdoc functions and structs crate-private

This gives warnings when code is no longer used, which will be helpful when rust-lang#77820 and rust-lang#78082 land.

AFAIK no one is using this API.

r? ``@GuillaumeGomez``
cc ``@rust-lang/rustdoc``
…r=RalfJung

Update E0744 about control flow in `const` contexts to accurately describe when the error is triggered and why

This PR fixes rust-lang#79083. `const fn` currently supports `if`, `match`, `loop`, and `while` in terms of control flow. The error relating to control flow in `const` contexts currently states that those control flow constructs are not allowed in `const` contexts. That is no longer true, as RFC 2342 and 2344 were [stabilized](rust-lang#72437). `for` loops, however, as well as `?` and `.await` are still not allowed, so I changed the error message to be more descriptive of the error as it is not just control flow that could trigger this error. I also added links to tracking issues that mark things that are blocking the usage of these expressions.
@rustbot rustbot added the rollup A PR which is a rollup label Nov 16, 2020
@m-ou-se
Copy link
Member Author

m-ou-se commented Nov 16, 2020

@bors r+ p=11 rollup=never

@bors
Copy link
Contributor

bors commented Nov 16, 2020

📌 Commit e6b6c8e has been approved by m-ou-se

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 16, 2020
@bors
Copy link
Contributor

bors commented Nov 16, 2020

⌛ Testing commit e6b6c8e with merge 4b6137c3b725a4d94ac0cbfe2619b207ba0e7693...

@pietroalbini
Copy link
Member

@bors retry

aarch64 was stuck

@bors
Copy link
Contributor

bors commented Nov 16, 2020

⌛ Testing commit e6b6c8e with merge c6a6105...

@bors
Copy link
Contributor

bors commented Nov 17, 2020

☀️ Test successful - checks-actions
Approved by: m-ou-se
Pushing c6a6105 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.