-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 5 pull requests #62561
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
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.
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.
@bors r+ p=5 rollup=never |
📌 Commit 3c299a9 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
Jul 10, 2019
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
💔 Test failed - checks-azure |
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
@bors retry |
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
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
☀️ Test successful - checks-azure, checks-travis, status-appveyor |
☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts. |
This was referenced Jul 11, 2019
Merged
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.
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:
!
#62465 (Sometimes generate storage statements for temporaries with type!
)fold
inIterator::last
default implementation #62481 (Usefold
inIterator::last
default implementation)std::ptr::{read,write}_unaligned
#62357: doc(ptr): add example for {read,write}_unaligned)Failed merges:
r? @ghost