-
Couldn't load subscription status.
- Fork 13.9k
Rollup of 5 pull requests #62561
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
Conversation
With `feature(never_type)`, it's not guaranteed that any variable with type `!` isn't ever assigned to.
Signed-off-by: Freyskeyd <[email protected]>
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 <[email protected]>
…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 |
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 retry |
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. |
Successful merges:
!#62465 (Sometimes generate storage statements for temporaries with type!)foldinIterator::lastdefault implementation #62481 (UsefoldinIterator::lastdefault implementation)std::ptr::{read,write}_unaligned#62357: doc(ptr): add example for {read,write}_unaligned)Failed merges:
r? @ghost