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 10 pull requests #54809

Merged
merged 23 commits into from
Oct 4, 2018
Merged

Rollup of 10 pull requests #54809

merged 23 commits into from
Oct 4, 2018

Conversation

pietroalbini
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

phungleson and others added 23 commits September 5, 2018 00:03
I noticed a small typo while reading over this document.
In  rust-lang#51833, I improved the performance of `copy_undef_mask()`. As such, the old FIXME wasn't appropriate anymore. The main remaining thing left to do is to implement a fast path for non-overlapping copies (per @oli-obk).
Joshua Netterfield reported an ICE when the unused-parentheses lint
triggered around an async block (rust-lang#54752). In order to compose an
autofixable suggestion, the lint invokes the pretty-printer on the
unnecessarily-parenthesized expression. (One wonders why the lint
doesn't just use `SourceMap::span_to_snippet` instead, to preserve the
formatting of the original source?—but for that, you'd have to ask the
author of 5c9f806.)

But then the pretty-printer panics when trying to call `<pprust::State
as PrintState>::end` when `State.boxes` is empty. Empirically, the
problem would seem to be solved if we start some "boxes" beforehand in
the `ast::ExprKind::Async` arm of the big match in
`print_expr_outer_attr_style`, exactly like we do in the
immediately-preceding match arm for `ast::ExprKind::Block`—it would
seem pretty ("pretty") reasonable for the pretty-printing of async
blocks to work a lot like the pretty-printing of ordinary non-async
blocks, right??

Of course, it would be shamefully cargo-culty to commit code on the
basis of this kind of mere reasoning-by-analogy (in contrast to
understanding the design of the pretty-printer in such detail that the
correctness of the patch is comprehended with all the lucid certainty
of mathematical proof, rather than being merely surmised by
intuition). But maybe we care more about fixing the bug with high
probability today, than with certainty in some indefinite hypothetical
future?  Maybe the effort is worth a fifth of a shirt??

Humbly resolves rust-lang#54752.
…ror, r=GuillaumeGomez

Add doc for impl From for Std Error

As part of issue rust-lang#51430 (cc @skade).

I am not sure if it is going to a correct direction so put up here so that people can comment.
…haelwoerister

simplify some unused lints code

Those are but small simplifications for readability.
Make spec_extend use for_each()

`for_each` will use an iterator's own implementation of `try_fold`, which I understand to be generally preferable (because nested iterator adapter's will use each other's `try_fold` and be designed for the specific adaptation in a way that promotes performance and inlining.
Fix typo in CONTRIBUTING.md

I noticed a small typo while reading over this document.
…i-obk

Update a FIXME in memory.rs

In  rust-lang#51833, I improved the performance of `copy_undef_mask()`. As such, the old FIXME wasn't appropriate anymore. The main remaining thing left to do is to implement a fast path for non-overlapping copies (per @oli-obk).

r? @oli-obk
…ertj

abolish ICE when pretty-printing async block

@jnetterf reported an ICE when the unused-parentheses lint triggered around an async block (rust-lang#54752). In order to compose an autofixable suggestion, the lint invokes the pretty-printer on the unnecessarily-parenthesized expression. (One wonders why the lint doesn't just use `SourceMap::span_to_snippet` instead, to preserve the formatting of the original source?—but to answer that, you'd have to ask the author of 5c9f806.)

But then the pretty-printer panics when trying to call `<pprust::State as PrintState>::end` when `State.boxes` is empty. Empirically, the problem would seem to be solved if we start some "boxes" beforehand in the `ast::ExprKind::Async` arm of the big match in `print_expr_outer_attr_style`, exactly like we do in the immediately-preceding match arm for `ast::ExprKind::Block`—it would seem pretty ("pretty") reasonable for the pretty-printing of async blocks to work a lot like the pretty-printing of ordinary non-async blocks, right??

Of course, it would be shamefully cargo-culty to commit code on the basis of this kind of mere reasoning-by-analogy (in contrast to understanding the design of the pretty-printer in such detail that the correctness of the patch is comprehended with all the lucid certainty of mathematical proof, rather than being merely surmised by intuition). But maybe we care more about fixing the bug with high probability today, than with certainty in some indefinite hypothetical future?  Maybe the effort is worth [a fifth of a shirt](https://hacktoberfest.digitalocean.com/stats/zackmdavis)??

Humbly resolves rust-lang#54752.

r? @cramertj
Remove duplicate predicates in `explicit_predicates_of`

I took a more brutal approach than described in rust-lang#52187. I could have used the `linked_hash_map` crate but this seems overkill, especially as we need a vec storage in the end.

r? @nikomatsakis
A handful of cleanups for rustc/mir

- use the "regular" `into()` instead of `graphviz::IntoCow` in `mod.rs`
- `format!("{}", x)` > `x.to_string()`
- remove one unnecessary `String` allocation
- shorten the logic of one loop
- `assert!(x == y)` > `assert_eq!(x, y)`
- whitespace & formatting fixes

r? @oli-obk
Introduce `TyKind::UnnormalizedProjection`

Introduce a new variant used for lazy normalization in chalk integration. Mostly `bug!` everywhere.

r? @nikomatsakis
remove padding from multiline format string label

Fixes rust-lang#53836.
@pietroalbini
Copy link
Member Author

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Oct 4, 2018

📌 Commit 71aded8 has been approved by pietroalbini

@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 Oct 4, 2018
@bors
Copy link
Contributor

bors commented Oct 4, 2018

⌛ Testing commit 71aded8 with merge 5472b07...

bors added a commit that referenced this pull request Oct 4, 2018
Rollup of 10 pull requests

Successful merges:

 - #53523 (Add doc for impl From for Std Error)
 - #54746 (simplify some unused lints code)
 - #54761 (Make spec_extend use for_each())
 - #54769 (Fix typo in CONTRIBUTING.md)
 - #54773 (Update a FIXME in memory.rs)
 - #54777 (abolish ICE when pretty-printing async block)
 - #54780 (Remove duplicate predicates in `explicit_predicates_of`)
 - #54788 (A handful of cleanups for rustc/mir)
 - #54789 (Introduce `TyKind::UnnormalizedProjection`)
 - #54795 (remove padding from multiline format string label)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Oct 4, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pietroalbini
Pushing 5472b07 to master...

@bors bors merged commit 71aded8 into rust-lang:master Oct 4, 2018
@bors bors mentioned this pull request Oct 4, 2018
@alexcrichton
Copy link
Member

This resulted in a relatively large regression in perf on a few benchmarks, was curious if others had a chance to dig into this yet?

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-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.