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 5 pull requests #62561

Merged
merged 40 commits into from
Jul 11, 2019
Merged

Rollup of 5 pull requests #62561

merged 40 commits into from
Jul 11, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jul 10, 2019

Successful merges:

Failed merges:

r? @ghost

eddyb and others added 30 commits July 2, 2019 09:33
With `feature(never_type)`, it's not guaranteed that any variable with
type `!` isn't ever assigned to.
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
Replace last impl with fold
attribute_to_string exists.
We always check against the length before indexing anyway.
There was only one callsite for each and this removes the
unwrap_or_default's on the comments argument
This also permits sharing the underlying code between pprust and
hir::print.
This function took too many arguments and are simple on the inside;
inlining them makes complexity go down.

hir::print's copy is unfortunately used from librustc_driver so inlining
it is not as straightforward.
This enforces that eof() must be called to get the String out, and
generally is better from an API perspective. No users of pretty printing
pre-allocate the buffer.
Presumably the code was from an older age of Rust and can now be written
much simpler.
These are somewhat ambiguous (beginning/end of what?) so it's better to
inline their one use into the code.
This is also easier to understand because the scan and print "tasks" are
separate, but previously were both called "print" or "pretty print."
It was always set to the string's length
Also moves it to pp::Printer from PrintState.
Mark-Simulacrum and others added 6 commits July 10, 2019 07:13
rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.

This slipped through the cracks and never got implemented (thankfully that just meant it was overly conservative and didn't allow assignments that don't *actually* drop the previous value).
Fixes rust-lang#62273.

r? @oli-obk
…=pnkfelix

Sometimes generate storage statements for temporaries with type `!`

Closes rust-lang#62165
cc rust-lang#42371
…each, r=scottmcm

Use `fold` in `Iterator::last` default implementation

We already use it in all the other methods.  Consistency + potential perf is a pretty nice win!
…unaligned, r=rkruppe

rust-lang#62357: doc(ptr): add example for {read,write}_unaligned

related to rust-lang#62357

> With rust-lang#62323 the only example (that had UB and was thus invalid) in std::ptr::read_unaligned and std::ptr::write_unaligned is removed.

> We should add a valid example of using the aforementioned functions.

Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
…p, r=petrochenkov

Some more cleanups to syntax::print

All of these changes should be functionally equivalent to previous code.

Each commit mostly stands alone and this PR is easiest to review by-commit.
@Centril
Copy link
Contributor Author

Centril commented Jul 10, 2019

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Jul 10, 2019

📌 Commit 3c299a9 has been approved by Centril

@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 Jul 10, 2019
@bors
Copy link
Contributor

bors commented Jul 10, 2019

⌛ Testing commit 3c299a9 with merge 0f7c4e6...

bors added a commit that referenced this pull request Jul 10, 2019
Rollup of 5 pull requests

Successful merges:

 - #62275 (rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.)
 - #62465 (Sometimes generate storage statements for temporaries with type `!`)
 - #62481 (Use `fold` in `Iterator::last` default implementation)
 - #62493 (#62357: doc(ptr): add example for {read,write}_unaligned)
 - #62532 (Some more cleanups to syntax::print)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Jul 10, 2019

💔 Test failed - checks-azure

@bors 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 Jul 10, 2019
@Centril
Copy link
Contributor Author

Centril commented Jul 10, 2019

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2019
@bors
Copy link
Contributor

bors commented Jul 10, 2019

⌛ Testing commit 3c299a9 with merge 35cacbc...

bors added a commit that referenced this pull request Jul 10, 2019
Rollup of 5 pull requests

Successful merges:

 - #62275 (rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.)
 - #62465 (Sometimes generate storage statements for temporaries with type `!`)
 - #62481 (Use `fold` in `Iterator::last` default implementation)
 - #62493 (#62357: doc(ptr): add example for {read,write}_unaligned)
 - #62532 (Some more cleanups to syntax::print)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Jul 11, 2019

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 11, 2019
@bryanburgers-bot
Copy link

☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts.

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.

None yet

8 participants