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 17 pull requests #81089

Merged
merged 60 commits into from
Jan 16, 2021
Merged

Rollup of 17 pull requests #81089

merged 60 commits into from
Jan 16, 2021

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Jan 16, 2021

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

frewsxcv and others added 30 commits December 17, 2020 22:55
After partially consuming a Zip adapter and then wrapping it into
another Zip where the adapters use their TrustedRandomAccess specializations
leads to the outer adapter returning elements which should have already been
consumed.
As per T-lang consensus, this uses a branch to handle the dangling case.
The discussed optimization of only doing the branch in the T: ?Sized
case is left for a followup patch, as doing so is not trivial
(as it requires specialization for correctness, not just optimization).
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/`.
Co-authored-by: Ralf Jung <post@ralfj.de>
…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.
…atsakis

Remove giant badge in README

Is it meant to be this big? I haven't seen any other open source project with this sort of thing
Explain why borrows can't be held across yield point in async blocks

For rust-lang#78938.
…ss-composition, r=m-ou-se

TrustedRandomAaccess specialization composes incorrectly for nested iter::Zips

I found this while working on improvements for TRA.

After partially consuming a Zip adapter and then wrapping it into another Zip where the adapters use their `TrustedRandomAccess` specializations leads to the outer adapter returning elements which should have already been consumed.

If the optimizer gets tripped up by the addition this might affect performance for chained `zip()` iterators even when the inner one is not partially advanced but it would require more extensive fixes to `TrustedRandomAccess` to communicate those offsets earlier.

Included test fails on nightly, [playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=24fa1edf8a104ff31f5a24830593b01f)
…-ou-se

Clarify what the effects of a 'logic error' are

This clarifies what a 'logic error' is (which is a term used to describe what happens if you put things in a hash table or btree and then use something like a refcell to break the internal ordering). This tries to be as vague as possible, as we don't really want to promise what happens, except "bad things, but not UB". This was discussed in rust-lang#80657
…RalfJung

Re-stabilize Weak::as_ptr and friends for unsized T

As per [T-lang consensus](https://hackmd.io/7r3_is6uTz-163fsOV8Vfg), this uses a branch to handle the dangling case. The discussed optimization of only doing the branch in the T: ?Sized case is left for a followup patch, as doing so is not trivial (as it requires specialization) and not _obviously_ better (as it requires using `wrapping_offset` rather than `offset` more).

<details><summary>Basically said optimization</summary>

Specialize on `T: Sized`:

```rust
fn as_ptr(&self) -> *const T {
    if [ T is Sized ] || !is_dangling(ptr) {
        (ptr as *mut T).set_ptr_value( (ptr as *mut u8).wrapping_offset(data_offset) )
    } else {
        ptr::null()
    }
}

fn from_raw(*const T) -> Self {
    if [ T is Sized ] || !ptr.is_null() {
        let ptr = (ptr as *mut RcBox).set_ptr_value( (ptr as *mut u8).wrapping_offset(-data_offset) );
        Weak { ptr }
    } else {
        Weak::new()
    }
}
```

(but with more `set_ptr_value` to avoid `Sized` restrictions and maintain metadata.)

Written in this fashion, this is not a correctness-critical specialization (i.e. so long as `[ T is Sized ]` is false for unsized `T`, it can be `rand()` for sized `T` without breaking correctness), but it's still touchy, so I'd rather do it in another PR with separate review.

---
</details>

This effectively reverts rust-lang#80422 and re-establishes rust-lang#74160. T-libs [previously signed off](rust-lang#74160 (comment)) on this stable API change in rust-lang#74160.
…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
…arkor

Do not suggest invalid code in pattern with loop

Fixes rust-lang#80913
…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
…ark-Simulacrum

Add a regression test for rust-lang#50041

AFAICT the test case never landed alongside the fix for the issue.
…=jyn514

codegen_cranelift: Fix redundant semicolon warn
…Simulacrum

Add sample code for Rc::new_cyclic
@rustbot rustbot added the rollup A PR which is a rollup label Jan 16, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 16, 2021

@bors r+ p=17 rollup=never

@bors
Copy link
Contributor

bors commented Jan 16, 2021

📌 Commit a6b2e1f 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 Jan 16, 2021
@bors
Copy link
Contributor

bors commented Jan 16, 2021

⌛ Testing commit a6b2e1f with merge 8a65184...

@bors
Copy link
Contributor

bors commented Jan 16, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 16, 2021
@bors bors merged commit 8a65184 into rust-lang:master Jan 16, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 16, 2021
@m-ou-se m-ou-se deleted the rollup-z7iac6i branch January 16, 2021 23:16
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.