-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rollup of 11 pull requests #79104
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Vadim Petrochenkov <[email protected]>
Co-authored-by: Vadim Petrochenkov <[email protected]> Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Yuki Okushi <[email protected]>
Co-authored-by: Camelid <[email protected]> Co-authored-by: Mark Rousskov <[email protected]>
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.
@bors r+ p=11 rollup=never |
📌 Commit e6b6c8e has been approved by |
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
⌛ Testing commit e6b6c8e with merge 4b6137c3b725a4d94ac0cbfe2619b207ba0e7693... |
@bors retry aarch64 was stuck |
☀️ Test successful - checks-actions |
This was referenced Nov 17, 2020
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
Index
andIndexMut
for arrays #74989 (ImplementIndex
andIndexMut
for arrays)const
contexts to accurately describe when the error is triggered and why #79087 (Update E0744 about control flow inconst
contexts to accurately describe when the error is triggered and why)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup