Skip to content

Rollup of 8 pull requests - #59632

Merged
bors merged 22 commits into
rust-lang:masterfrom
Centril:rollup
Apr 2, 2019
Merged

Rollup of 8 pull requests#59632
bors merged 22 commits into
rust-lang:masterfrom
Centril:rollup

Conversation

@Centril

Copy link
Copy Markdown
Contributor

Successful merges:

Failed merges:

r? @ghost

timvermeulenand others added 22 commits March 17, 2019 16:57
We can use `usize::try_from` to convert steps from any size of integer.
This enables a meaningful `size_hint()` for larger ranges, rather than
always just `(0, None)`. Now they return the true `(len, Some(len))`
when it fits, otherwise `(usize::MAX, None)` for overflow.
* Don't promote these borrows if we're going to remove them before
codegen
* Correctly mark unreachable code
async fn now lowers directly to an existential type declaration
rather than reusing the `impl Trait` return type lowering.
As part of this, it lowers all argument-position elided lifetimes
using the in-band-lifetimes machinery, creating fresh parameter
names for each of them, using each lifetime parameter as a generic
argument to the generated existential type.
This doesn't currently successfully allow multiple
argument-position elided lifetimes since `existential type`
doesn't yet support multiple lifetimes where neither outlive
the other. This requires a separate fix.
…scottmcm
Remove duplicated code from Iterator::{ne, lt, le, gt, ge}
This PR delegates `Iterator::ne` to `Iterator::eq` and `Iterator::{lt, le, gt, ge}` to `Iterator::partial_cmp`.
Oddly enough, this change actually simplifies the generated assembly [in some cases](https://rust.godbolt.org/z/riBtNe), although I don't understand assembly well enough to see if the longer assembly is doing something clever.
I also added two extremely simple benchmarks:
```
// before
test iter::bench_lt ... bench: 98,404 ns/iter (+/- 21,008)
test iter::bench_partial_cmp ... bench: 62,437 ns/iter (+/- 5,009)
// after
test iter::bench_lt ... bench: 61,757 ns/iter (+/- 8,770)
test iter::bench_partial_cmp ... bench: 62,151 ns/iter (+/- 13,753)
```
I have no idea why the current `lt`/`le`/`gt`/`ge` implementations don't seem to be compiled optimally, but simply having them call `partial_cmp` seems to be an improvement.
See rust-lang#44729 for a previous discussion.
Refactor async fn return type lowering
async fn now lowers directly to an existential type declaration
rather than reusing the `impl Trait` return type lowering.
As part of this, it lowers all argument-position elided lifetimes
using the in-band-lifetimes machinery, creating fresh parameter
names for each of them, using each lifetime parameter as a generic
argument to the generated existential type.
This doesn't currently successfully allow multiple
argument-position elided lifetimes since `existential type`
doesn't yet support multiple lifetimes where neither outlive
the other:
```rust
existential type Foo<'a, 'b>:; // error: ambiguous lifetime bound in `impl Trait`
fn foo<'a, 'b>(_: &'a u8, _: &'b u8) -> Foo<'a, 'b> { () }
```
This requires a separate fix.
Fixrust-lang#59001Fixrust-lang#58885Fixrust-lang#55324Fixrust-lang#54974
Progress on rust-lang#56238
r? @nikomatsakis
Implement useful steps_between for all integers
We can use `usize::try_from` to convert steps from any size of integer.
This enables a meaningful `size_hint()` for larger ranges, rather than
always just `(0, None)`. Now they return the true `(len, Some(len))`
when it fits, otherwise `(usize::MAX, None)` for overflow.
…nkfelix
Fixes for shallow borrows
* Don't promote these borrows if we're going to remove them before
codegen
* Correctly mark unreachable code
…InterpError, r=oli-obk
Renames `EvalErrorKind` to `InterpError`
This PR renames `EvalErrorKind` to `InterpError`.
This is related to rust-lang#54395.
…r=alexcrichton
SGX target: convert a bunch of panics to aborts
Fixesfortanix/rust-sgx#86, fortanix/rust-sgx#103 and in general protect preemptively against Iago attacks by aborting instead of unwinding in potentially unexpected situations.
@Centril

Copy link
Copy Markdown
ContributorAuthor

@bors r+ p=8

@bors

bors commented Apr 2, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit d0d3466 has been approved by Centril

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 2, 2019
@bors

bors commented Apr 2, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d0d3466 with merge e008e4f...

bors added a commit that referenced this pull request Apr 2, 2019
Rollup of 8 pull requests
Successful merges:
- #59262 (Remove duplicated code from Iterator::{ne, lt, le, gt, ge})
- #59286 (Refactor async fn return type lowering)
- #59444 (Implement useful steps_between for all integers)
- #59452 (Speed up rustdoc run a bit)
- #59533 (Support allocating iterators with arenas)
- #59585 (Fixes for shallow borrows)
- #59607 (Renames `EvalErrorKind` to `InterpError`)
- #59613 (SGX target: convert a bunch of panics to aborts)
Failed merges:
- #59630 (Shrink `mir::Statement`.)
r? @ghost
@bors

bors commented Apr 2, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing e008e4f to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Apr 2, 2019
@bors
bors merged commit d0d3466 into rust-lang:masterApr 2, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.rollupA PR which is a rollupS-waiting-on-borsStatus: 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.

9 participants

@Centril@bors@timvermeulen@cuviper@GuillaumeGomez@matthewjasper@kenta7777@Zoxc@cramertj