Skip to content

Rollup of 9 pull requests #140239

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

Merged
merged 24 commits into from
Apr 24, 2025
Merged

Rollup of 9 pull requests #140239

merged 24 commits into from
Apr 24, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

tgross35 and others added 24 commits April 3, 2025 19:20
Included API:

    impl<T: Copy> Cell<T> {
        pub fn update(&self, f: impl FnOnce(T) -> T);
    }

Closes: rust-lang#50186
 - With `Context` wrapped by `SmirInterface`, the stable-mir's TLV stores a pointer to `SmirInterface`, while the rustc-specific TLV stores a pointer to tables.
 - This PR make the `rustc_smir` mod public.
Specifically, this allows string literal patterns to be used where a
`str` is expected when `deref_patterns` is enabled.
Specifically, this allows byte string literal patterns to be used where
a `[u8]` or `[u8;N]` is expected when `deref_patterns` is enabled.
This has other warnings if necessary and doesn't need extra warnings
from this FCW.

cc rust-lang#138762
The `synstructure` docs say "This method is a no-op, underscore consts
are used by default now." The behaviour change occurred going from
`synstructure` version 0.13.0 to 0.13.1.
An upcoming lint will want to be able to know if a lifetime is
hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`,
`ContainsLifetime<'_>`). It will also want to know if the lifetime is
related to a reference (`&u8`) or a path (`ContainsLifetime`).
I found these by grepping for `&[a-z_\.]*\.clone()`, i.e. expressions
like `&a.b.clone()`, which are sometimes unnecessary clones, and also
looking at clones nearby to cases like that.
Pass `args` to `run` instead of storing it in a field. This avoids the
need to clone it within `run`.

Also, change `args` from `Vec<String>` to `&[String]`, avoiding the need
for some vecs and clones.
…jhpratt

Stabilize the `cell_update` feature

Included API:

```rust
impl<T: Copy> Cell<T> {
    pub fn update(&self, f: impl FnOnce(T) -> T);
}
```

FCP completed once at rust-lang#50186 (comment) but the signature has since changed.

Closes: rust-lang#50186
std: Add performance warnings to HashMap::get_disjoint_mut

Closes rust-lang#139296

The `get_disjoint_mut` in `HashMap` also performs a complexity O(n^2) check. So we need to be reminded of that as well.

https://github.com/rust-lang/hashbrown/blob/b5b0655a37e156f9798ac8dd7e970d4adba9bf90/src/raw/mod.rs#L1216-L1220
…ss35

Impl new API `std::os::unix::fs::mkfifo` under feature `unix_fifo`

Tracking issue rust-lang#139324
…fJung

Don't warn about `v128` in wasm ABI transition

The `-Zwasm-c-abi=spec` mode of `extern "C"` does not actually change the meaning of `v128`  meaning that the FCW lint firing is a false positive.

cc rust-lang#138762 (comment)
StableMIR: Implement `CompilerInterface`

This PR implements part of [the document](https://hackmd.io/``@celinaval/H1lJBGse0).``

With `TablesWrapper` wrapped by `CompilerInterface`, the stable-mir's TLV stores a pointer to `CompilerInterface`, while the rustc-specific TLV stores a pointer to tables.
…rce, r=nnethercote

Extend HIR to track the source and syntax of a lifetime

An upcoming lint will want to be able to know if a lifetime is hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`, `ContainsLifetime<'_>`). It will also want to know if the lifetime is related to a reference (`&u8`) or a path (`ContainsLifetime`).

r? ``@nnethercote``
`deref_patterns`: support string and byte string literals in explicit `deref!("...")` patterns

When `deref_patterns` is enabled, this allows string literal patterns to be used where `str` is expected and byte string literal patterns to be used where `[u8]` or `[u8; N]` is expected. This lets them be used in explicit `deref!("...")` patterns to match on `String`, `Box<str>`, `Vec<u8>`, `Box<[u8;N]>`, etc. (as well as to match on slices and arrays obtained through other means). Implementation-wise, this follows up on rust-lang#138992: similar to how byte string literals matching on `&[u8]` is implemented, this changes the type of the patterns as determined by HIR typeck, which informs const-to-pat on how to translate them to THIR (though strings needed a bit of extra work since we need references to call `<str as PartialEq>::eq` in the MIR lowering for string equality tests).

This PR does not add support for implicit deref pattern syntax (e.g. `"..."` matching on `String`, as `string_deref_patterns` allows). I have that implemented locally, but I'm saving it for a follow-up PR[^1].

This also does not add support for using named or associated constants of type `&str` where `str` is expected (nor likewise with named byte string constants). It'd be possible to add that if there's an appetite for it, but I figure it's simplest to start with literals.

This is gated by the `deref_patterns` feature since it's motivated by deref patterns. That said, its impact reaches outside of deref patterns; it may warrant a separate experiment and feature gate, particularly factoring in the follow-up[^1]. Even without deref patterns, I think there's probably motivation for these changes.

The update to the unstable book added by this will conflict with rust-lang#140022, so they shouldn't be merged at the same time.

Tracking issue for deref patterns: rust-lang#87121

r? ``@oli-obk``
cc ``@Nadrieril``

[^1]: The piece missing from this PR to support implicit deref pattern syntax is to allow string literal patterns to implicitly dereference their scrutinees before matching (see rust-lang#44849). As a consequence, it also makes examples like the one in that issue work (though it's still gated by `deref_patterns`). I can provide more information on how I've implemented it or open a draft if it'd help in reviewing this PR.
…=compiler-errors

Remove `synstructure::Structure::underscore_const` calls.

The `synstructure` docs say "This method is a no-op, underscore consts are used by default now." The behaviour change occurred going from `synstructure` version 0.13.0 to 0.13.1.

r? ``@SparrowLii``
… r=SparrowLii

Remove unnecessary clones

r? `@SparrowLii`
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. labels Apr 24, 2025
@rustbot rustbot added the rollup A PR which is a rollup label Apr 24, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 24, 2025

📌 Commit 986750d 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 24, 2025
@bors
Copy link
Collaborator

bors commented Apr 24, 2025

⌛ Testing commit 986750d with merge dc8fe1f81c6cf13c0987944c525b2aa81625b5d0...

@bors
Copy link
Collaborator

bors commented Apr 24, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2025
@bors bors merged commit dc8fe1f into rust-lang:master Apr 24, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 24, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 7f69523 (parent) -> dc8fe1f (this PR)

Test differences

Show 374 test diffs

Stage 0

  • os::unix::fs::tests::test_mkfifo: [missing] -> pass (J1)

Stage 1

  • [ui] tests/ui/pattern/byte-string-mutability-mismatch.rs: [missing] -> pass (J2)
  • [ui] tests/ui/pattern/deref-patterns/byte-string-type-errors.rs: [missing] -> pass (J2)
  • [ui] tests/ui/pattern/deref-patterns/strings.rs: [missing] -> pass (J2)
  • os::unix::fs::tests::test_mkfifo: [missing] -> pass (J3)

Stage 2

  • [ui] tests/ui/pattern/byte-string-mutability-mismatch.rs: [missing] -> pass (J0)
  • [ui] tests/ui/pattern/deref-patterns/byte-string-type-errors.rs: [missing] -> pass (J0)
  • [ui] tests/ui/pattern/deref-patterns/strings.rs: [missing] -> pass (J0)

Additionally, 366 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard dc8fe1f81c6cf13c0987944c525b2aa81625b5d0 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. aarch64-apple: 3691.7s -> 4822.6s (30.6%)
  2. dist-aarch64-linux: 7562.7s -> 5487.4s (-27.4%)
  3. dist-apple-various: 7955.6s -> 6709.7s (-15.7%)
  4. dist-x86_64-apple: 9631.3s -> 8490.9s (-11.8%)
  5. x86_64-gnu-llvm-20-2: 5902.0s -> 6582.6s (11.5%)
  6. mingw-check: 1202.4s -> 1337.4s (11.2%)
  7. x86_64-apple-1: 7103.8s -> 7829.4s (10.2%)
  8. dist-aarch64-apple: 5201.7s -> 4767.1s (-8.4%)
  9. x86_64-msvc-2: 7184.7s -> 6735.2s (-6.3%)
  10. dist-x86_64-netbsd: 5045.3s -> 5289.2s (4.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#134446 Stabilize the cell_update feature 35d70595ba24e26cd27f006c3b8716240ebf596e (link)
#139307 std: Add performance warnings to HashMap::get_disjoint_mut ff0998111f52ef11de3ccdb3d89663127cf2eafc (link)
#139450 Impl new API std::os::unix::fs::mkfifo under feature `uni… 863ed5a01303568d19395b6ffafdeb6b07fc898d (link)
#139809 Don't warn about v128 in wasm ABI transition 3d6e33ee7927fba89587b34749998a262d92c982 (link)
#139852 StableMIR: Implement CompilerInterface 25c77954c190138a850ef6c0fd442f6da4ff6d09 (link)
#139945 Extend HIR to track the source and syntax of a lifetime 045d2b013fc2d98eff0c24e87444b47cae348554 (link)
#140028 deref_patterns: support string and byte string literals i… 5cbf073d092d04328abd76cbbf53b811b1a929c0 (link)
#140181 Remove synstructure::Structure::underscore_const calls. 76170cb2308bafb61615e271c494fe84375284ca (link)
#140232 Remove unnecessary clones 8d482b4500331eaf84d26a7172fcbd1ee3dcaf69 (link)

previous master: 7f695232a8

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

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (primary 0.8%, secondary -5.1%)

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)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
-5.1% [-5.1%, -5.1%] 1
All ❌✅ (primary) 0.8% [-1.0%, 2.6%] 2

Cycles

Results (primary -0.4%)

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

Binary size

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

Bootstrap: 776.02s -> 777.711s (0.22%)
Artifact size: 365.11 MiB -> 365.16 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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.