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 8 pull requests #123913

Merged
merged 22 commits into from
Apr 14, 2024
Merged

Rollup of 8 pull requests #123913

merged 22 commits into from
Apr 14, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

tgross35 and others added 22 commits April 8, 2024 17:43
The `thread_local!` examples use `RefCell` for `Copy` types. Update
examples to have one `Copy` and one non-`Copy` type using `Cell` and
`RefCell`, respectively.
Reduce `unsafe` block scope and add `SAFETY` comments.
This is in accordance with Clippy's redundant_closure_for_method_calls.
Original diff from @notgull in rust-lang#118349, small changes from me.

on OpenBSD, getsockname(2) returns the actual size of the socket address, and 
not the len of the content. Figure out the length for ourselves.
see https://marc.info/?l=openbsd-bugs&m=170105481926736&w=2

Fixes rust-lang#116523
This change makes tidy to handle run-make checks with a single iteration,
avoiding the need for multiple iterations and copying.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Add a helper macro for adding common methods to command wrappers. Common
methods include helpers that delegate to `Command` and running methods.

- `arg` and `args` (delegates to `Command`)
- `env`, `env_remove` and `env_clear` (delegates to `Command`)
- `output`, `run` and `run_fail`

This helps to avoid needing to copy-pasta / reimplement these common
methods on a new command wrapper, which hopefully reduces the friction
for run-make test writers wanting to introduce new command wrappers.
Removes the manual copy-pasta'd implementation of common methods.
…ark-Simulacrum

Thread local updates for idiomatic examples

Update thread local examples to make more idiomatic use of `Cell` for `Copy` types, `RefCell` for non-`Copy` types.

Also shrink the size of `unsafe` blocks, add `SAFETY` comments, and fix `clippy::redundant_closure_for_method_calls`.
…mulacrum

run-make-support: tidy up support library

- Make `handle_failed_output` take `&Command` instead of having the caller keep doing `format!("{:#?}", s)`.
- Introduce a helper macro for implementing common command wrappers, such as `arg`, `args`, `run`, `run_fail`.
    - Use the helper macro on existing command wrappers and remove manual copy-pasta'd implementations.
…Mark-Simulacrum

OpenBSD fix long socket addresses

Original diff from ``@notgull`` in rust-lang#118349, small changes from me.

on OpenBSD, getsockname(2) returns the actual size of the socket address, and  not the len of the content. Figure out the length for ourselves. see https://marc.info/?l=openbsd-bugs&m=170105481926736&w=2

Fixes rust-lang#116523
Doc: replace x with y for hexa-decimal fmt

I found it a bit unintuitive to know which is variable and which is the format string in `format!("{x:x}")`, so I switched it to `y`.
…mulacrum

Add missing `unsafe` to some internal `std` functions

Adds `unsafe` to a few internal functions that have safety requirements but were previously not marked as `unsafe`. Specifically:

- `std::sys::pal::unix::thread::min_stack_size` needs to be `unsafe` as `__pthread_get_minstack` might dereference the passed pointer. All callers currently pass a valid initialised `libc::pthread_attr_t`.
- `std::thread::Thread::new` (and `new_inner`) need to be `unsafe` as it requires the passed thread name to be valid UTF-8, otherwise `Thread::name` will trigger undefined behaviour. I've taken the opportunity to split out the unnamed thread case into a separate `new_unnamed` function to make the safety requirement clearer. All callers meet the safety requirement now that rust-lang#123505 has been merged.
…mulacrum

reduce tidy overheads in run-make checks

This change makes tidy to handle run-make checks with a single iteration, avoiding the need for multiple iterations and copying.
…, r=compiler-errors

Generic associated consts: Check regions earlier when comparing impl with trait item def

Fixes rust-lang#123836.

r? compiler-errors or compiler
…lacrum

compiletest: Update rustfix to 0.8.1

This updates the version of rustfix used in compiletest to be closer to what cargo is using. This is to help ensure `cargo fix` and compiletest are aligned. There are some unpublished changes to `rustfix`, which will update in a future PR when those are published.

Will plan to update ui_test in the near future to avoid the duplicate.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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 Apr 14, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Apr 14, 2024

📌 Commit ab65c68 has been approved by matthiaskrgr

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

bors commented Apr 14, 2024

⌛ Testing commit ab65c68 with merge 78bc0a5...

@bors
Copy link
Contributor

bors commented Apr 14, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 78bc0a5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 14, 2024
@bors bors merged commit 78bc0a5 into rust-lang:master Apr 14, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 14, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#123651 Thread local updates for idiomatic examples 90ede6e547a449aab04d4daf92a1e9f1d0f961c4 (link)
#123699 run-make-support: tidy up support library bb1166f8a109b42c78be0596587e7778bc5f63aa (link)
#123779 OpenBSD fix long socket addresses b611570f54f3f43a564c62d60ebb6866bf20a350 (link)
#123875 Doc: replace x with y for hexa-decimal fmt 0619979a427982d6384c7bceb8e04d5b9bf96fd0 (link)
#123879 Add missing unsafe to some internal std functions a931b9ceb28ffdf92542248fb4d0a68f264dcb49 (link)
#123889 reduce tidy overheads in run-make checks 5878919bb894eceda6f0b7dc5ccd3088c0ec5df0 (link)
#123898 Generic associated consts: Check regions earlier when compa… f63aefb78c1575748b836349d32bad04e6e6b4e9 (link)
#123902 compiletest: Update rustfix to 0.8.1 bfeeb5dea2a3c34e852b49636054aa2f5515c8df (link)

previous master: a3269e920c

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 (78bc0a5): comparison URL.

Overall result: ✅ improvements - 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.4%, -0.2%] 5
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

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)
- - 0
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
-7.9% [-7.9%, -7.9%] 1
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

Cycles

Results

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)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-8.1% [-8.5%, -7.6%] 3
All ❌✅ (primary) - - 0

Binary size

Results

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.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.1%, 0.0%] 3

Bootstrap: 676.944s -> 677.009s (0.01%)
Artifact size: 315.97 MiB -> 315.96 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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
None yet
Development

Successfully merging this pull request may close these issues.