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 9 pull requests #127840

Merged
merged 24 commits into from
Jul 17, 2024
Merged

Rollup of 9 pull requests #127840

merged 24 commits into from
Jul 17, 2024

Conversation

tgross35
Copy link
Contributor

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

mgeisler and others added 24 commits May 21, 2024 15:36
I’ve found myself visiting the documentation for `std::env::vars`
every few months, and every time I do, it is because I want to quickly
get a snippet to print out all environment variables :-)

So I think it could be nice to simplify the examples a little to make
them self-contained. It is of course a style question if one should
import a module a not, but I personally don’t import modules used just
once in a code snippet.
Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
There are some comments describing multiple subsequent `use` items. When
the big `use` reformatting happens some of these `use` items will be
reordered, possibly moving them away from the comment. With this
additional level of formatting it's not really feasible to have comments
of this type. This commit removes them in various ways:

- merging separate `use` items when appropriate;

- inserting blank lines between the comment and the first `use` item;

- outright deletion (for comments that are relatively low-value);

- adding a separate "top-level" comment.

We also entirely skip formatting for four library files that contain
nothing but `pub use` re-exports, where reordering would be painful.
When we do the big `use` reformatting there are a tiny number of cases
where rustfmt moves a comment from one `use` item to another in an
undesirable way. This commit pre-emptively rearranges things to prevent
this from happening.
This also adds an additional `unsafe` block to address compiler errors.
Co-authored-by: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
…jhpratt,tgross35

Simplify environment variable examples

I’ve found myself visiting the documentation for `std::env::vars` every few months, and every time I do, it is because I want to quickly get a snippet to print out all environment variables :-)

So I think it could be nice to simplify the examples a little to make them self-contained. It is of course a style question if one should import a module a not, but I personally don’t import modules used just once in a code snippet.
… r=tgross35

Skip fast path for dec2flt when optimize_for_size

Tracking issue: rust-lang#125612

Skip the fast algorithm when optimizing for size.
When compiling for https://github.com/quartiq/stabilizer I get these numbers:

Before
```
   text    data     bss     dec     hex filename
 192192       8   49424  241624   3afd8 dual-iir
```

After
```
   text    data     bss     dec     hex filename
 191632       8   49424  241064   3ada8 dual-iir
```

This saves 560 bytes.
…ps-2, r=cuviper

Clean up more comments near use declarations

rust-lang#125443 will reformat all use declarations in the repository. There are a few edge cases involving comments on use declarations that require care. This PR fixes them up so rust-lang#125443 can go ahead with a simple `x fmt --all`. A follow-up to rust-lang#126717.

r? ``@cuviper``
`impl Send + Sync` and override `count` for the `CStr::bytes` iterator

cc tracking issue rust-lang#112115
…kargs, r=compiler-errors

Terminate `--print link-args` output with newline

Fixes rust-lang#127507
…warfier, r=joboet

std: Use `read_unaligned` for reads from DWARF

There's a lot of... *stuff* going on here. Meanwhile, `read_unaligned` has been available since 1.17.0, so let's just use that.
Use futex.rs for Windows thread parking

If I'm not overlooking anything then the Windows 10+ thread parking implementation is practically the same as the futex.rs implementation. So we may as well use the same implementation for both. The old version is still kept around for Windows 7 support.

r? ````@joboet```` if you wouldn't mind double checking I've not missed something
…kingjubilee

zkvm: add `#[forbid(unsafe_op_in_unsafe_fn)]` in `stdlib`

This also adds an additional `unsafe` block to address compiler errors.
This PR is intended to address rust-lang#127747 for the zkvm target.
…n-xous-uefi, r=tgross35

std: Forbid unwrapped unsafe ops in xous and uefi modules
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs O-hermit Operating System: Hermit O-SGX Target: SGX O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ labels Jul 17, 2024
@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 17, 2024
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jul 17, 2024

📌 Commit 1a1b44f has been approved by tgross35

It is now in the queue for this repository.

@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 17, 2024
@bors
Copy link
Contributor

bors commented Jul 17, 2024

⌛ Testing commit 1a1b44f with merge a28b35e...

@bors
Copy link
Contributor

bors commented Jul 17, 2024

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing a28b35e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 17, 2024
@bors bors merged commit a28b35e into rust-lang:master Jul 17, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 17, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#125206 Simplify environment variable examples 3b31f2023819db0db33856bf8aa028e4401b9f0e (link)
#126271 Skip fast path for dec2flt when optimize_for_size d49abe1ee4d8841ab5e52815adfb155e56221696 (link)
#126776 Clean up more comments near use declarations 74c99e16ac81ceec07391fe8e27bccbf91a96072 (link)
#127444 impl Send + Sync and override count for the `CStr::byte… 6fb596eae36a6f87da2f8cd504b702bd1141c29d (link)
#127512 Terminate --print link-args output with newline f01ddf09685151a23eec5cd59c2f5f3da2001cb9 (link)
#127792 std: Use read_unaligned for reads from DWARF fbe38ea3c4f6d3273f6cd153f5f147010b012f5c (link)
#127807 Use futex.rs for Windows thread parking c6bb80998134160f275ec490dbb8ae09b553c36b (link)
#127833 zkvm: add #[forbid(unsafe_op_in_unsafe_fn)] in stdlib 4cbfb11b3280068bc4bcbafde50caac467a2f2b9 (link)
#127836 std: Forbid unwrapped unsafe ops in xous and uefi modules d54aa42a8447d4008fb40f3a7f1f5830e8789b5d (link)

previous master: 1a6e777c3c

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a28b35e): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -1.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.5% [4.4%, 4.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-3.5%, -2.2%] 10
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.376s -> 768.03s (-0.17%)
Artifact size: 328.66 MiB -> 328.66 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. O-hermit Operating System: Hermit O-SGX Target: SGX O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.