Commit graph

307094 commits

Author SHA1 Message Date
Oli Scherer
179da5da69
Merge pull request #4615 from rust-lang/rustup-2025-10-03
Automatic Rustup
2025-10-03 06:26:54 +00:00
The Miri Cronjob Bot
6beb612c13 Merge ref '3b8665c5ab' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 3b8665c5ab
Filtered ref: 67ff7e0b0141ef570f3c1ca7e643faf55b58b7f1
Upstream diff: 42b384ec0d...3b8665c5ab

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-03 05:00:28 +00:00
The Miri Cronjob Bot
8583e1582e Prepare for merging from rust-lang/rust
This updates the rust-version file to 3b8665c5ab.
2025-10-03 04:52:46 +00:00
Jules Bertholet
d6fdadb8e9
Mitigate thread_local! shadowing issues
Mitigates https://github.com/rust-lang/rust/issues/147006
and https://github.com/rust-lang/rust/issues/99018
2025-10-03 00:00:39 -04:00
bors
3b8665c5ab Auto merge of #147282 - Zalathar:rollup-7wz3k9r, r=Zalathar
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#141839 (make rust-analyzer use a dedicated build directory)
 - rust-lang/rust#146166 (Implement range support in `//@ edition`)
 - rust-lang/rust#147259 (cg_llvm: Use helper methods for all calls to `LLVMMDNodeInContext2`)
 - rust-lang/rust#147263 (Disable triagebot auto stable-regression compiler backport nominations pending redesign)
 - rust-lang/rust#147268 (add arm-maintainers to various targets)
 - rust-lang/rust#147270 (Move doc_cfg-specific code into `cfg.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-03 00:49:22 +00:00
Stuart Cook
9e1b24d9e4
Rollup merge of #147270 - GuillaumeGomez:move-cfg-code, r=lolbinarycat
Move doc_cfg-specific code into `cfg.rs`

Follow-up of https://github.com/rust-lang/rust/pull/138907.

r? lolbinarycat
2025-10-03 09:16:29 +10:00
Stuart Cook
87c7946c8f
Rollup merge of #147268 - davidtwco:add-arm-maintainers-to-targets, r=lqd
add arm-maintainers to various targets

Add the ``@rust-lang/arm-maintainers`` team as maintainers to the following targets:

- `aarch64-unknown-linux-gnu`
- `aarch64-unknown-none`/`aarch64-unknown-none-softfloat`
- `aarch64-unknown-uefi`
- `armv7-unknown-linux-gnueabi`/`armv7-unknown-linux-gnueabihf`
- `armv7a-none-eabi`/`armv7a-none-eabihf`
- `armv7r-none-eabi`/`armv7r-none-abihf`
- `armv8r-none-eabihf`
- `thumbv7em-none-eabi`/`thumbv7em-none-eabihf`
- `thumbv7m-none-eabi`
- `thumbv8m.base-none-eabi`
- `thumbv8m.main-none-eabi`/`thumbv8m.main-none-eabihf`

cc `@thejpster`
2025-10-03 09:16:29 +10:00
Stuart Cook
179d182c83
Rollup merge of #147263 - jieyouxu:disable-auto-backport-nominations, r=apiraino,Urgau
Disable triagebot auto stable-regression compiler backport nominations pending redesign

Current auto compiler stable-regression backport nominations seem to be too aggressive, and seems to unfortunately lower signal-to-noise ratio of the compiler backport channel. So this PR disables the triagebot compiler auto stable-regression backport nominations pending a redesign. Beta-regression auto backport nominations are not modified, we might want to gather some more experience with it.

No prejudice against re-enabling them if the nominations include a bit more context on _why_ it's automatically nominated and _which_ regression(s) are being addressed. Or as proposed, it could also simply become a reminder-to-nominate _comment_.

cf. [#t-compiler/backports > #146919: stable-nominated @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports/topic/.23146919.3A.20stable-nominated/near/540979327)

> I like the idea of rustbot just posting a message that suggests adding the label. That seems like a good compromise between avoiding forgotten nominations and avoiding spurious nominations.

In any case, this was very much worth experimenting!

r? `@apiraino` (or triagebot)
2025-10-03 09:16:28 +10:00
Stuart Cook
7a011558aa
Rollup merge of #147259 - Zalathar:node-in-context, r=nnethercote
cg_llvm: Use helper methods for all calls to `LLVMMDNodeInContext2`

Originally I was only planning on extracting an `md_node_in_context` method, but then I noticed that all callers of `LLVMMDNodeInContext2` could be covered by a small number of additional helper methods.

There should be no change in compiler output.
2025-10-03 09:16:27 +10:00
Stuart Cook
6fe05b5162
Rollup merge of #146166 - ferrocene:pvdrz/edition-range, r=fmease,jieyouxu
Implement range support in `//@ edition`

First step to solve https://github.com/rust-lang/rust/issues/145364
2025-10-03 09:16:27 +10:00
Stuart Cook
a3291ede1a
Rollup merge of #141839 - tshepang:ease-lsp-use, r=Mark-Simulacrum,fee1-dead
make rust-analyzer use a dedicated build directory

inspired by https://github.com/rust-lang/rust/pull/132794
2025-10-03 09:16:26 +10:00
bors
8d603ef287 Auto merge of #147231 - CrooseGit:dev/reucru01/extend_rustc_force_inline, r=saethlin
Extending `#[rustc_force_inline]` to be applicable to inherent methods

`#[rustc_force_inline]` is an internal-only attribute similar to `#[inline(always)]` but which emits an error if inlining cannot occur. rustc_force_inline uses the MIR inliner to do this and has limitations on where it can be applied to ensure that an error is always emitted if inlining can't happen (e.g. it can't be applied to trait methods because calls to those can't always be resolved).

`#[rustc_force_inline]` is motivated by AArch64 pointer authentication intrinsics where it is vital for the security properties of these intrinsics that they do not exist in standalone functions that could be used as gadgets in an exploit (if they could, then you could sign whatever pointers you want, for example, which is bad, but if you force inlining, then you can't jump to a reusable function containing only these instructions).

Since its initial implementation, `#[rustc_force_inline]` could only be applied to free functions. This can be relaxed to also allow inherent methods while still preserving the desired properties. In a work-in-progress patch for manual pointer authentication intrinsics, it is useful to introduce types with inherent methods that would need to be force inlined.

r? `@saethlin`
2025-10-02 21:43:10 +00:00
Christian Poveda
6631c8ef55
Document range syntax on the rustc dev guide 2025-10-02 11:13:22 -05:00
Pietro Albini
c61ec946d2
implement range support in //@ edition 2025-10-02 11:13:20 -05:00
bors
5c7ae0c7ed Auto merge of #147196 - LorrensP-2158466:same-res-ambiguity-test, r=petrochenkov
Test: Ambigious bindings in same namespace with the same res

Add a test based on the discussion [here](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/near/542316157) and related to https://github.com/rust-lang/rust/issues/145575#issuecomment-3228868375.

This is the most reduced form I could create that passes on nightly but fails with rust-lang/rust#145108 (see [#gsoc > Project: Parallel Macro Expansion @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/near/542335131)).

Also not sure about the test names.

r? `@petrochenkov`
2025-10-02 15:23:49 +00:00
David Wood
7715c0d648
add arm-maintainers to various targets 2025-10-02 15:42:05 +01:00
Guillaume Gomez
6275a19255 Move doc_cfg-specific code into cfg.rs 2025-10-02 15:24:04 +02:00
bors
94ecb52bbe Auto merge of #147261 - matthiaskrgr:rollup-yh3fgvc, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#146281 (Support `#[rustc_align_static]` inside `thread_local!`)
 - rust-lang/rust#146535 (mbe: Implement `unsafe` attribute rules)
 - rust-lang/rust#146585 (indexing: reword help)
 - rust-lang/rust#147004 (Tweak handling of "struct like start" where a struct isn't supported)
 - rust-lang/rust#147221 (Forbid `//@ compile-flags: -Cincremental=` in tests)
 - rust-lang/rust#147225 (Don't enable shared memory by default with Wasm atomics)
 - rust-lang/rust#147227 (implement `Box::take`)
 - rust-lang/rust#147233 (Initialize llvm submodule if not already the case to run citool)
 - rust-lang/rust#147236 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-02 11:14:37 +00:00
Reuben Cruise
5bf5e71160 Extends rustc_force_inline to inherent methods
- Changes parser to allow application to inherent methods.
- Adds tests to confirm extended functionality works just as the existing.
2025-10-02 11:30:11 +01:00
Jieyou Xu
16cfde9703
triagebot: disable auto stable-regression compiler backport nominations
No prejudice against re-enabling them if the nominations include a bit
more context on _why_ it's automatically nominated and _which_
regression(s) are being addressed. Or as proposed, it could also simply
become a reminder-to-nominate _comment_.
2025-10-02 17:21:40 +08:00
Matthias Krüger
2d1efe76bc
Rollup merge of #147236 - rustbot:docs-update, r=ehuss
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)
2025-10-02 10:27:53 +02:00
Matthias Krüger
f4dcfa6ddb
Rollup merge of #147233 - GuillaumeGomez:citool-submodule-init, r=Kobzol
Initialize llvm submodule if not already the case to run citool

While working on https://github.com/rust-lang/rust/pull/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``
2025-10-02 10:27:53 +02:00
Matthias Krüger
fbe6834ac0
Rollup merge of #147227 - edwloef:box_take, r=joboet
implement `Box::take`

Tracking issue: https://github.com/rust-lang/rust/issues/147212

I'm not entirely sure about the wording of the doc comment, if anyone has any suggestions that'd be great :)
2025-10-02 10:27:52 +02:00
Matthias Krüger
8a18176c92
Rollup merge of #147225 - daxpedda:wasm-u-u-atomics-threads, 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/rust#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/rust#77839.
r? ``@alexcrichton``
2025-10-02 10:27:52 +02:00
Matthias Krüger
b78b1070e3
Rollup merge of #147221 - Zalathar:incremental, r=lqd
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.
2025-10-02 10:27:51 +02:00
Matthias Krüger
e041b2c078
Rollup merge of #147004 - estebank:ascription-in-pat, r=fee1-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.
2025-10-02 10:27:50 +02:00
Matthias Krüger
7320d3ed61
Rollup merge of #146585 - hkBst:indexing-1, r=jdonszelmann
indexing: reword help

After looking at https://github.com/rust-lang/rust/issues/40850, I thought I'd try to improve wording around error E0608 a bit. Hopefully I've succeeded.
2025-10-02 10:27:49 +02:00
Matthias Krüger
ac7beab527
Rollup merge of #146535 - joshtriplett:mbe-unsafe-attr, r=petrochenkov
mbe: Implement `unsafe` attribute rules

This implements `unsafe attr` rules for declarative `macro_rules!` attributes, as specified in [RFC 3697](https://github.com/rust-lang/rfcs/pull/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: https://github.com/rust-lang/rust/issues/143547
2025-10-02 10:27:49 +02:00
Matthias Krüger
92aac1bdf6
Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, r=Mark-Simulacrum
Support `#[rustc_align_static]` inside `thread_local!`

Tracking issue: rust-lang/rust#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
2025-10-02 10:27:48 +02:00
bors
4b9c62b4da Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnr
Split Bound index into Canonical and Bound

See [#t-types/trait-system-refactor > perf `async-closures/post-mono-higher-ranked-hang.rs`](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context

Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run.

r? lcnr
2025-10-02 08:09:33 +00:00
Zalathar
8ef9821bf2 Extract helper method global_set_metadata_node 2025-10-02 18:06:58 +10:00
Zalathar
6a58f80a3c Extract helper method global_add_metadata_node 2025-10-02 18:06:57 +10:00
Zalathar
ffeed2b94e Extract helper method module_add_named_metadata_node 2025-10-02 18:04:24 +10:00
Zalathar
ecb831dcf4 Extract helper method set_metadata_node 2025-10-02 18:04:23 +10:00
Ralf Jung
d3bb22fe4d
Merge pull request #4613 from RalfJung/rustup
Rustup
2025-10-02 07:50:43 +00:00
Ralf Jung
a5d1629370 make cur_span and current_span harder to mix up 2025-10-02 09:25:19 +02:00
Ralf Jung
38d129eeb4 rustup 2025-10-02 09:13:29 +02:00
bors
42b384ec0d Auto merge of #147055 - beepster4096:subtype_is_not_a_projection, r=lcnr
Turn ProjectionElem::Subtype into CastKind::Subtype

I noticed that drop elaboration can't, in general, handle `ProjectionElem::SubType`. It creates a disjoint move path that overlaps with other move paths. (`Subslice` does too, and I'm working on a different PR to make that special case less fragile.) If its skipped and treated as the same move path as its parent then `MovePath.place` has multiple possible projections. (It would probably make sense to remove all `Subtype` projections for the canonical place but it doesn't make sense to have this special case for a problem that doesn't actually occur in real MIR.)

The only reason this doesn't break is that `Subtype` is always the sole projection of the local its applied to. For the same reason, it works fine as a `CastKind` so I figured that makes more sense than documenting and validating this hidden invariant.

cc rust-lang/rust#112651, rust-lang/rust#133258

r? Icnr (bc you've been the main person dealing with `Subtype` it looks like)
2025-10-02 01:54:48 +00:00
Zalathar
59c4dfe59d 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.

Instead, use the `//@ incremental` directive, which instructs compiletest to
handle the details of passing `-Cincremental` with a fresh directory.
2025-10-02 11:16:03 +10:00
Josh Triplett
4fc0a0d42a mbe: expand_invoc: Add comment about not needing to check safety of 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.
2025-10-01 16:19:39 -07:00
Josh Triplett
ea0e00c573 mbe: Add tests for unsafe attr invocation 2025-10-01 16:19:39 -07:00
Josh Triplett
05c5b87797 mbe: Add parsing tests for unsafe macro rules 2025-10-01 16:19:39 -07:00
Josh Triplett
6bff1abf9d mbe: Support unsafe attribute rules 2025-10-01 16:19:39 -07:00
Josh Triplett
30d57abccf mbe: Rename a local variable to match corresponding field names
This simplifies subsequent initialization of enum variants.
2025-10-01 16:19:39 -07:00
bors
3369e82c6b Auto merge of #147210 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to a6bc4a4bbe.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-10-01 21:58:22 +00:00
bors
4da69dfff1 Auto merge of #147235 - matthiaskrgr:rollup-a0es1x9, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#146593 (Allow specifying multiple bounds for same associated item, except in trait objects)
 - rust-lang/rust#147177 ([DebugInfo] Fix MSVC tuple child creation)
 - rust-lang/rust#147195 (iter repeat: add tests for new count and last behavior)
 - rust-lang/rust#147202 (Swap order of `resolve_coroutine_interiors` and `handle_opaque_type_uses`)
 - rust-lang/rust#147204 (Refactor ArrayWindows to use a slice)
 - rust-lang/rust#147219 (Add proper error handling for closure in impl)
 - rust-lang/rust#147226 (include `outer_inclusive_binder` of pattern types)
 - rust-lang/rust#147230 (Fix typo in 'unfulfilled_lint_expectation' to plural)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-01 18:45:43 +00:00
rustbot
5991c8703d Update books 2025-10-01 19:14:45 +02:00
Matthias Krüger
de67301a28
Rollup merge of #147230 - demoray:patch-1, r=jdonszelmann
Fix typo in 'unfulfilled_lint_expectation' to plural
2025-10-01 18:42:39 +02:00
Matthias Krüger
8e289788f9
Rollup merge of #147226 - jdonszelmann:pattern-types-next-solver, r=lcnr
include `outer_inclusive_binder` of pattern types

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/237

r? ```@lcnr```
2025-10-01 18:42:38 +02:00
Matthias Krüger
ae60ebd46d
Rollup merge of #147219 - Kivooeo:typeof-is-imposter, r=jdonszelmann
Add proper error handling for closure in impl

Fixes https://github.com/rust-lang/rust/issues/147146
Fixes https://github.com/rust-lang/rust/issues/146620

Not sure if it can cause any regressions or anything, as for test also have no idea where to store this one

cc ```@theemathas```

r? compiler
2025-10-01 18:42:37 +02:00