Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Oct 2, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 27 commits September 24, 2025 21:31
This improves the case where someone tries to write a `match` expr where the patterns have type ascription syntax. Makes them less verbose, by giving up on the first encounter in the block, and makes them more accurate by only treating them as a struct literal if successfuly parsed as such.
Co-authored-by: beef <ent3rm4n@gmail.com>
This simplifies subsequent initialization of enum variants.
… `LegacyAttr` here

`LegacyAttr` is only used for builtin attributes, and builtin attributes
have their safety checked by `check_attribute_safety`, so we don't need
to check `unsafety` here.
Tests should not try to manually enable incremental compilation with
`-Cincremental`, because that typically results in stray directories being
created in the repository root.

Instead, use the `//@ incremental` directive, which instructs compiletest to
handle the details of passing `-Cincremental` with a fresh directory.
…d-local, r=Mark-Simulacrum

Support `#[rustc_align_static]` inside `thread_local!`

Tracking issue: rust-lang#146177

```rust
thread_local! {
    #[rustc_align_static(64)]
    static SO_ALIGNED: u64 = const { 0 };
}
```

This increases the amount of recursion the macro performs (once per attribute in addition to the previous once per item), making it easier to hit the recursion limit. I’ve added workarounds to limit the impact in the case of long doc comments, but this still needs a crater run just in case.

r? libs

``@rustbot`` label A-attributes A-macros A-thread-locals F-static_align T-libs
…trochenkov

mbe: Implement `unsafe` attribute rules

This implements `unsafe attr` rules for declarative `macro_rules!` attributes, as specified in [RFC 3697](rust-lang/rfcs#3697).

An invocation of an attribute that uses an `unsafe attr` rule requires the `unsafe(attr(...))` syntax.

An invocation of an attribute that uses an ordinary `attr` rule must *not* use the `unsafe(attr(...))` syntax.

`unsafe` is only supported on an `attr` rule, not any other kind of `macro_rules!` rule.

Tracking issue for `macro_rules!` attributes: rust-lang#143547
indexing: reword help

After looking at rust-lang#40850, I thought I'd try to improve wording around error E0608 a bit. Hopefully I've succeeded.
…-dead

Tweak handling of "struct like start" where a struct isn't supported

This improves the case where someone tries to write a `match` expr where the patterns have type ascription syntax. Makes them less verbose, by giving up on the first encounter in the block, and makes them more accurate by only treating them as a struct literal if successfully parsed as such.

Before, encountering something like `match a { b:` would confuse the parser and think everything after `match` *must* be a struct, and if it wasn't it would generate a cascade of unnecessary diagnostics.
Forbid `//@ compile-flags: -Cincremental=` in tests

Tests should not try to manually enable incremental compilation with `-Cincremental`, because that typically results in stray directories being created in the repository root.

Also, if the incremental directory is not cleared, there is a risk of interference between successive runs of the same test.

Instead, use the `//@ incremental` directive, which instructs compiletest to handle the details of passing `-Cincremental` with a fresh directory.
… r=alexcrichton

Don't enable shared memory by default with Wasm atomics

This prepares us for a future where LLVM eventually stabilizes the atomics target feature, in which case we don't want to inflate atomics with threads. Otherwise users would be stuck with shared memory even when they don't want it/need it.

### Context

Currently the atomics target features is unstable and can't be used without re-building Std with it (`-Zbuild-std`).
Enabling the atomics target feature automatically enables shared memory.
Shared memory is required to actually allow multi-threading.
However, shared memory comes with a performance overhead when atomic instructions aren't able to be lowered to regular memory access instructions or when interacting with certain Web APIs.
So it is very undesirable to enable shared memory by default for the majority of users.

While it is possible to use atomics without shared memory, the question remains what use-case this scenario has.
The only one I can think of would involve multiple memories, where the main memory remains un-shared but a second shared memory exists. While Rust doesn't support multiple memories, it might be possible with inline assembly (rust-lang#136382).

So alternatively, we might consider *not* enabling atomics by default even when LLVM does. In which case everything would remain the same.

---

This will break current Web multi-threading users. To address this they can add the following `RUSTFLAGS`:
```
-Clink-args=--shared-memory,--max-memory=1073741824,--import-memory,--export=__wasm_init_tls,--export=__tls_size,--export=__tls_align,--export=__tls_base
```

We could add a new experimental flag that enables the right linker arguments for users, but I feel that's not in Rusts scope. Or like suggested before: a Rust-only `threads` target feature.

Addresses rust-lang#77839.
r? ``@alexcrichton``
implement `Box::take`

Tracking issue: rust-lang#147212

I'm not entirely sure about the wording of the doc comment, if anyone has any suggestions that'd be great :)
…it, r=Kobzol

Initialize llvm submodule if not already the case to run citool

While working on rust-lang#146414, I ran the following command (to run CI docker locally):

```
cargo run --manifest-path src/ci/citool/Cargo.toml run-local --type pr x86_64-gnu-gcc
```

However, since I didn't have `src/llvm` submodule initialized, it failed. Apparently it's a common issue for people using this tool so this PR removes this small inconvenience.

r? ``@Kobzol``
Update books

## rust-lang/book

1 commits in 33f1af40cc44dde7e3e892f7a508e6f427d2cbc6..1d7c3e6abec2d5a9bfac798b29b7855b95025426
2025-09-28 21:24:16 UTC to 2025-09-28 21:24:16 UTC

- Chunk of chapters from copyedit (rust-lang/book#4506)

## rust-lang/edition-guide

1 commits in aa6ce337c0adf7a63e33960d184270f2a45ab9ef..e2ed891f00361efc26616d82590b1c85d7a8920e
2025-10-01 17:11:54 UTC to 2025-10-01 17:11:54 UTC

- link to never type fallback lint as deny by default (rust-lang/edition-guide#377)

## rust-lang/nomicon

1 commits in f17a018b9989430967d1c58e9a12c51169abc744..23fc2682f8fcb887f77d0eaabba708809f834c11
2025-09-24 10:10:31 UTC to 2025-09-24 10:10:31 UTC

- a typo in ffi.md (rust-lang/nomicon#502)

## rust-lang/reference

13 commits in cc7247d8dfaef4c39000bb12c55c32ba5b5ba976..e11adf6016a362766eea5a3f9832e193994dd0c8
2025-09-29 00:55:42 UTC to 2025-09-23 23:33:32 UTC

- const functions: separate rule about users and rule about what is allowed in such functions (rust-lang/reference#2013)
- use "tuple enum variant" more consistently (rust-lang/reference#2015)
- Remove caveats related to `format_args!` expansion (rust-lang/reference#2017)
- RISC-V: Extension Updates (including document references) (rust-lang/reference#2002)
- Move inferred sentence to an example block (rust-lang/reference#2019)
- Add triagebot range-diff feature (rust-lang/reference#2011)
- use AND when searching for multiple terms (rust-lang/reference#2016)
- enumerations.md: fix pluralisation (rust-lang/reference#2014)
- const_eval.md: use sentence case for section title, for consistency (rust-lang/reference#2012)
- destructors.md: improve readability by adding pauses (rust-lang/reference#2007)
- RISC-V: Add vector state registers (rust-lang/reference#2005)
- destructors.md: point to core:: instead of std:: (rust-lang/reference#2006)
- Create Whitespace grammar productions (rust-lang/reference#1991)
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner labels Oct 2, 2025
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure 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 Oct 2, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Oct 2, 2025

📌 Commit 2d1efe7 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 Oct 2, 2025
@bors
Copy link
Collaborator

bors commented Oct 2, 2025

⌛ Testing commit 2d1efe7 with merge 94ecb52...

@bors
Copy link
Collaborator

bors commented Oct 2, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 2, 2025
@bors bors merged commit 94ecb52 into rust-lang:master Oct 2, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 2, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#146281 Support #[rustc_align_static] inside thread_local! 07a183340509505136393da70e8a79fed79561ef (link)
#146535 mbe: Implement unsafe attribute rules 822e8105c27ec1a6e2bb198111852e6634b263dc (link)
#146585 indexing: reword help f17764e7dbaad9182911b1ddfdc4352ac491f564 (link)
#147004 Tweak handling of "struct like start" where a struct isn't … 90c36f550dfd4f290b380f234c13c42c03805f68 (link)
#147221 Forbid //@ compile-flags: -Cincremental= in tests b5f9296159636e5f4b25a44b1ebdb9dfe7ced2eb (link)
#147225 Don't enable shared memory by default with Wasm atomics 8765099037c69f24aa1c9a87a4942ef5493fc34f (link)
#147227 implement Box::take 5d2eee8754246202213379cb59baa9c0eceadd8d (link)
#147233 Initialize llvm submodule if not already the case to run ci… 70c7ce9856143d380b25ac16a1b4ef410715f675 (link)
#147236 Update books 576a8c064750e8423025e4c97f35a7226c574216 (link)

previous master: 4b9c62b4da

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

Copy link
Contributor

github-actions bot commented Oct 2, 2025

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 4b9c62b (parent) -> 94ecb52 (this PR)

Test differences

Show 346 test diffs

Stage 1

  • [ui] tests/ui/compiletest-self-test/compile-flags-incremental.rs#bad: [missing] -> pass (J0)
  • [ui] tests/ui/compiletest-self-test/compile-flags-incremental.rs#bad-space: [missing] -> pass (J0)
  • [ui] tests/ui/compiletest-self-test/compile-flags-incremental.rs#good: [missing] -> pass (J0)
  • [ui] tests/ui/feature-gates/feature-gate-static_align-thread_local.rs: [missing] -> pass (J0)
  • [ui] tests/ui/thread-local/long-docs.rs: [missing] -> pass (J0)
  • [ui] tests/ui/thread-local/no-unstable.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/compiletest-self-test/compile-flags-incremental.rs#bad: [missing] -> pass (J1)
  • [ui] tests/ui/compiletest-self-test/compile-flags-incremental.rs#bad-space: [missing] -> pass (J1)
  • [ui] tests/ui/compiletest-self-test/compile-flags-incremental.rs#good: [missing] -> pass (J1)
  • [ui] tests/ui/feature-gates/feature-gate-static_align-thread_local.rs: [missing] -> pass (J1)
  • [ui] tests/ui/thread-local/long-docs.rs: [missing] -> pass (J1)
  • [ui] tests/ui/thread-local/no-unstable.rs: [missing] -> pass (J1)

Additionally, 334 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 94ecb52bbeeccc990545d4ebc9e9c35dcaf285e3 --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: 7463.3s -> 9941.8s (33.2%)
  2. x86_64-rust-for-linux: 3033.8s -> 2538.6s (-16.3%)
  3. dist-ohos-aarch64: 4075.3s -> 4402.3s (8.0%)
  4. dist-x86_64-apple: 7770.4s -> 7209.8s (-7.2%)
  5. aarch64-msvc-2: 4828.9s -> 5115.5s (5.9%)
  6. dist-aarch64-apple: 6884.4s -> 7246.1s (5.3%)
  7. i686-gnu-nopt-2: 7887.4s -> 8289.3s (5.1%)
  8. dist-ohos-armv7: 4226.4s -> 4015.3s (-5.0%)
  9. x86_64-msvc-1: 9377.4s -> 8918.5s (-4.9%)
  10. dist-aarch64-msvc: 5909.4s -> 5626.9s (-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

Finished benchmarking commit (94ecb52): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (secondary 3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.6% [0.8%, 6.6%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary 2.7%, secondary 3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
3.4% [3.1%, 3.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Binary size

Results (primary 1.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Bootstrap: 471.25s -> 470.352s (-0.19%)
Artifact size: 387.76 MiB -> 387.80 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Oct 2, 2025
@bors bors mentioned this pull request Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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-infra Relevant to the infrastructure 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.