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 #122803

Merged
merged 35 commits into from Mar 21, 2024
Merged

Rollup of 8 pull requests #122803

merged 35 commits into from Mar 21, 2024

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Mar 21, 2024

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

m-ou-se and others added 30 commits March 19, 2024 15:27
SeqCst is unnecessary here.
SeqCst is unnecessary here.
Relaxed is enough to make sure this `swap` results in `true` only once.
No need for SeqCst. Release+Acquire is the right memory ordering for a
mutex.
SeqCst is unnecessary. Release+Acquire is the right ordering for a
mutex.
Relaxed is enough to ensure fetch_add(1) returns each integer exactly
once.
SeqCst is unnecessary. Release+Acquire is the right ordering for a
mutex.
The SeqCst wasn't synchronizing with anything. Relaxed is enough.
rustc is just one tool/executable, even if at the center of the toolchain
These assertions detect situations where a BCB node would have both a physical
counter and one or more in-edge counters/expressions.

For most BCBs that situation would indicate an implementation bug. However,
it's perfectly fine in the case of a BCB having an edge that loops back to
itself.

Given the complexity and risk involved in fixing the assertions, and the fact
that nothing relies on them actually being true, this patch just removes them
instead.
SeqCst isn't necessary in any of these cases.
Relaxed is enough to have fetch_add(1) return each value only once
(until it wraps around).
Relaxed memory ordering is fine because spawn()/join() already provides
all the synchronization we need.
Relaxed is enough here. Synchronization is done by the mutex.
The code

    let _ = fs::remove_dir_all(&dir);
    create_dir_all(&dir).unwrap();

is duplicated in 7 places. Let's introduce a helper.
…=petrochenkov

Ignore paths from expansion in `unused_qualifications`

If any of the path segments are from an expansion the lint is skipped currently, but a path from an expansion where all of the segments are passed in would not be. Doesn't seem that likely to occur but it could happen
Relax SeqCst ordering in standard library.

Every single SeqCst in the standard library is unnecessary. In all cases, Relaxed or Release+Acquire was sufficient.

As I [wrote](https://marabos.nl/atomics/memory-ordering.html#common-misconceptions) in my book on atomics:

> [..] when reading code, SeqCst basically tells the reader: "this operation depends on the total order of every single SeqCst operation in the program," which is an incredibly far-reaching claim. The same code would likely be easier to review and verify if it used weaker memory ordering instead, if possible. For example, Release effectively tells the reader: "this relates to an acquire operation on the same variable," which involves far fewer considerations when forming an understanding of the code.
>
> It is advisable to see SeqCst as a warning sign. Seeing it in the wild often means that either something complicated is going on, or simply that the author did not take the time to analyze their memory ordering related assumptions, both of which are reasons for extra scrutiny.

r? ````@Amanieu```` ````@joboet````
use more accurate terminology

rustc is just one tool/executable, even if at the center of the toolchain
…rors

make `type_flags(ReError) & HAS_ERROR`

Self-explanatory. `TypeVisitableExt::references_error(ReError)` incorrectly returned `false`.
coverage: Remove incorrect assertions from counter allocation

These assertions detect situations where a BCB node (in the coverage graph) would have both a physical counter and one or more in-edge counters/expressions.

For most BCBs that situation would indicate an implementation bug. However, it's perfectly fine in the case of a BCB having an edge that loops back to itself.

Given the complexity and risk involved in fixing the assertions, and the fact that nothing relies on them actually being true, this patch just removes them instead.

Fixes rust-lang#122738.

`````@rustbot````` label +A-code-coverage
…ng-usize-max, r=Nilstrieb

Add `usize::MAX` arg tests for Vec

Tests to prevent recurrence of the UB from the rust-lang#122760 issue.

I skipped the `with_capacity`, `drain`, `reserve`, etc. APIs because they actually had a good assortment of tests earlier in the same file.

r? Nilstrieb
… r=onur-ozkan

compiletest: Introduce `remove_and_create_dir_all()` helper

The code

    let _ = fs::remove_dir_all(&dir);
    create_dir_all(&dir).unwrap();

is duplicated in 7 places. Let's introduce a helper.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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 Mar 21, 2024
@jhpratt
Copy link
Member Author

jhpratt commented Mar 21, 2024

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Mar 21, 2024

📌 Commit f25397a has been approved by jhpratt

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

bors commented Mar 21, 2024

⌛ Testing commit f25397a with merge 6a6cd65...

@bors
Copy link
Contributor

bors commented Mar 21, 2024

☀️ Test successful - checks-actions
Approved by: jhpratt
Pushing 6a6cd65 to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#122545 Ignore paths from expansion in unused_qualifications f9b0e581363e8b979cc2b6a846391c7d4c822a40 (link)
#122729 Relax SeqCst ordering in standard library. 81ac794249396af3426fa15870436227beefbb1d (link)
#122740 use more accurate terminology 18a81ea001701cbeaaeffa8d29f3d07821d41ee7 (link)
#122749 make type_flags(ReError) & HAS_ERROR fa215aedbfa0df72df63a54590c0e4f9ec1c91ca (link)
#122764 coverage: Remove incorrect assertions from counter allocati… 3c5bdc55b3da426f8af1c24aa0ebc25e90f22776 (link)
#122765 Add usize::MAX arg tests for Vec c55939e8e743bf65445b092a911fa08f31f5ad03 (link)
#122776 Rename hir::Let into hir::LetExpr 60952d21752504b4003b863e1428efc23bb378a5 (link)
#122786 compiletest: Introduce remove_and_create_dir_all() helper 99a01a799b792f8a0836b09340585fa3b1b8665a (link)

previous master: 6ec953c5ea

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 (6a6cd65): 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)
1.7% [1.7%, 1.7%] 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

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

Binary size

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

Bootstrap: 669.714s -> 669.782s (0.01%)
Artifact size: 312.80 MiB -> 312.72 MiB (-0.02%)

@jhpratt jhpratt deleted the rollup-nmgs79k branch March 29, 2024 05:44
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 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-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.

None yet