-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 10 pull requests #81068
Closed
Closed
Rollup of 10 pull requests #81068
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
Fix whitespace
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
There was one directory that had only a single test and there was also a test in the top-level directory. This moves both of them to `feature-gates/`.
…s.rs Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
The use of Result allows for making use of a reconstructed original value on failed projections.
See rust-lang#77433 for why the new heuristic was chosen. Fixes rust-lang#77433
The first parse is to collect whether the code contains macros, has `main`, and uses other crates. In that pass we ignore errors as those will be reported when the test file is actually built. For that we need to reset errors in the `Diagnostic` otherwise when dropping it unhandled errors will be reported as compiler bugs. Fixes rust-lang#80992
…ottmcm Always use extend in BinaryHeap::append This is faster, see rust-lang#77433. Fixes rust-lang#77433
Introduce {Ref, RefMut}::try_map for optional projections in RefCell This fills a usability gap of `RefCell` I've personally encountered to perform optional projections, mostly into collections such as `RefCell<Vec<T>>` or `RefCell<HashMap<U, T>>`: > This kind of API was briefly featured under Open questions in rust-lang#10514 back in 2013 (!) ```rust let values = RefCell::new(vec![1, 2, 3, 4]); let b = Ref::opt_map(values.borrow(), |vec| vec.get(2)); ``` It primarily avoids this alternative approach to accomplish the same kind of projection which is both rather noisy and panicky: ```rust let values = RefCell::new(vec![1, 2, 3, 4]); let b = if values.get(2).is_some() { Some(Ref::map(values.borrow(), |vec| vec.get(2).unwrap())) } else { None }; ``` ### Open questions The naming `opt_map` is preliminary. I'm not aware of prior art in std to lean on here, but this name should probably be improved if this functionality is desirable. Since `opt_map` consumes the guard, and alternative syntax might be more appropriate which instead *tries* to perform the projection, allowing the original borrow to be recovered in case it fails: ```rust pub fn try_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Result<Ref<'b, U>, Self> where F: FnOnce(&T) -> Option<&U>; ``` This would be more in line with the `try_map` method [provided by parking lot](https://docs.rs/lock_api/0/lock_api/struct.RwLockWriteGuard.html#method.try_map).
Explain why borrows can't be held across yield point in async blocks For rust-lang#78938.
…crum Make `x.py --color always` apply to logging too Follow-up to rust-lang#78548, rust-lang#79004. r? `@Mark-Simulacrum`
…acrum Add a regression test for rust-lang#76281 This has been fixed between 1.47.0-nightly (663d2f5 2020-08-22) and 1.47.0-nightly (5180f3d 2020-08-23). Maybe fixed by rust-lang#73526? Created `wasm` dir, it currently has only one test but I'll move some wasm-related tests there as a follow-up. Closes rust-lang#76281
…Simulacrum Stabilize the poll_map feature Stabilizes the `poll_map` feature as tracked by rust-lang#63514 (with a completed FCP).
…nization, r=Mark-Simulacrum Put all feature gate tests under `feature-gates/` There was one directory that had only a single test and there was also a test in the top-level directory. This moves both of them to `feature-gates/`.
…r=jyn514 Remove doctree::Import Per the title. Part of cleaning up doctree
doctest: Reset errors before dropping the parse session The first parse is to collect whether the code contains macros, has `main`, and uses other crates. In that pass we ignore errors as those will be reported when the test file is actually built. For that we need to reset errors in the `Diagnostic` otherwise when dropping it unhandled errors will be reported as compiler bugs. Fixes rust-lang#80992
…=jyn514 codegen_cranelift: Fix redundant semicolon warn
@bors r+ rollup=never p=10 |
📌 Commit c8bca90 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
Jan 16, 2021
⌛ Testing commit c8bca90 with merge ef26af3c6f7ae8101b8f7a51e32c432ea1d3bcd2... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
bors
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Jan 16, 2021
That failure doesn't seem to be related to any of the changes in this rollup. Spurious, maybe? Starting a new rollup. Let's see if it happens again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
rollup
A PR which is a rollup
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
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:
x.py --color always
apply to logging too #80901 (Makex.py --color always
apply to logging too)feature-gates/
#80971 (Put all feature gate tests underfeature-gates/
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup