Commit graph

312571 commits

Author SHA1 Message Date
Jakub Beránek
9f8bfd6b4a Revert "Rollup merge of #149147 - chenyukang:yukang-fix-unused_assignments-macro-gen-147648, r=JonathanBrouwer"
This reverts commit 82a17b30d8, reversing
changes made to 5019bdaefe.

(cherry picked from commit 74387157c7)
2026-01-08 16:08:18 -08:00
bors
72b6488ba4 Auto merge of #150214 - cuviper:beta-next, r=cuviper
[beta] backports

- attempt to fix unreachable code regression rust-lang/rust#149664
- Update to LLVM 21.1.8 rust-lang/rust#150057
- Revert rust-lang/rust#148937 -- rust-lang/rust#150096

r? cuviper
2025-12-21 04:14:38 +00:00
Amanieu d'Antras
4bc6d75592 Revert #148937 (Remove initialized-bytes tracking from BorrowedBuf and BorrowedCursor)
This caused several performance regressions because of existing code
which uses `Read::read` and therefore requires full buffer
initialization. This is particularly a problem when the same buffer is
re-used for multiple read calls since this means it needs to be fully
re-initialized each time.

There is still some benefit to landing the API changes, but we will have
to add private APIs so that the existing infrastructure can
track and avoid redundant initialization.

(cherry picked from commit 4b07875505)
2025-12-20 13:58:49 -08:00
Nikita Popov
834ced45a4 Update to LLVM 21.1.8
(cherry picked from commit f33abb17db)
2025-12-20 13:54:29 -08:00
Kivooeo
3f4f07f0b9 add check for uninhabited types along side never
(cherry picked from commit 2a2da782d3)
2025-12-20 13:54:03 -08:00
bors
e17ea4bf4e Auto merge of #149951 - BoxyUwU:beta_bump_stage0, r=cuviper
[beta] bump stage0

r? release
2025-12-18 21:10:55 +00:00
bors
6dfb8017ed Auto merge of #149900 - ranger-ross:backport-cargofix, r=weihanglo
[beta-1.93] Backport Cargo bug fix for 1.93

2 commits in 2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac..083ac5135f967fd9dc906ab057a2315861c7a80d
2025-12-04 16:47:28 +0000 to 2025-12-11 23:19:46 -0500
- [beta-1.93] Backport locking fixes (rust-lang/cargo#16386)
- [beta-1.93] Downgrade curl-sys to 0.4.83 (rust-lang/cargo/pull/16399)
2025-12-16 03:12:22 +00:00
Ross Sullivan
2a8e61f538
Backport Cargo bug fixes for Rust 1.93 2025-12-16 11:40:55 +09:00
bors
eb937a3172 Auto merge of #149799 - lnicola:backport-disable-postcard, r=lnicola
[beta] Backport rust-analyzer proc macro server "disable postcard use temporarily"
2025-12-14 18:25:26 +00:00
Boxy Uwu
de868f6b43 bump stage0 2025-12-13 14:31:45 +00:00
Lukas Wirth
51da96d7d2 fix: Disable postcard use temporarily 2025-12-09 08:55:41 +02:00
bors
1b6e21e163 Auto merge of #149760 - BoxyUwU:beta, r=BoxyUwU
[beta] prepare rust 1.93.0

r? `@ghost`
2025-12-08 15:58:14 +00:00
Boxy Uwu
f80e3ac624 bump channel 2025-12-08 10:08:52 +00:00
Boxy Uwu
3c55c98ec8 replace version placeholder 2025-12-08 10:08:32 +00:00
bors
66428d92be Auto merge of #149682 - matthiaskrgr:rollup-serlk7i, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#148662 (alloc: Document panics when allocations will exceed max)
 - rust-lang/rust#148811 (core docs: rewrite `panic::Location::caller` with visual line/column numbers)
 - rust-lang/rust#149101 (Improve mutable-binding suggestion to include name)
 - rust-lang/rust#149477 (float::maximum/minimum: make docs more streamlined)
 - rust-lang/rust#149547 (library: Rename `IterRange*` to `Range*Iter`)
 - rust-lang/rust#149548 (Generate delegation error body when delegation is not resolved)
 - rust-lang/rust#149630 (Check identifiers defined in macros when suggesting identifiers hidden by hygiene)
 - rust-lang/rust#149647 (Add regression test for 141845)
 - rust-lang/rust#149661 (Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.)
 - rust-lang/rust#149666 (Add perma-unstable `--print=backend-has-zstd` for use by compiletest)
 - rust-lang/rust#149671 (interpret: test SNaN handling of float min/max and update comments)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-05 16:20:35 +00:00
Matthias Krüger
a43b30c113
Rollup merge of #149671 - RalfJung:interpret-float-min-max, r=mati865
interpret: test SNaN handling of float min/max and update comments

Also see https://github.com/rust-lang/rust/pull/149563.

I also renamed these enum variants so they are not almost identical.
2025-12-05 16:17:13 +01:00
Matthias Krüger
8e46521d0e
Rollup merge of #149666 - Zalathar:backend-has-zstd, r=jieyouxu
Add perma-unstable `--print=backend-has-zstd` for use by compiletest

Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built without support for zstd compression.

Currently, compiletest relies on messy and fragile heuristics to detect whether the compiler's LLVM was built with zstd support. But the compiler itself already knows whether LLVM has zstd or not, so it's easier for compiletest to just ask the compiler.

---

Originally I was intending for this to be a `--print=debuginfo-compression` flag that would print out a list of values supported by `-Zdebuginfo-compression=`. I got that working locally, but it was more complex than I was happy with (in both rustc and compiletest), so I decided to cut scope and instead add a very narrow perma-unstable print request instead.

There is always a circularity hazard whenever we ask the compiler-under-test for information about how to test it. But in this case, the underlying compiler code is fairly simple, whereas the previous heuristics were inherently messy and unreliable anyway.
2025-12-05 16:17:12 +01:00
Matthias Krüger
93249823c2
Rollup merge of #149661 - alinas:llvm-22-runtimelibraryinfo-fix, r=cuviper
Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.

LLVM added codegen decision making based on RuntimeLibraryInfo. Mirror the change in Rust's codegen.

LLVM reference commit:
04c81a9973.
2025-12-05 16:17:11 +01:00
Matthias Krüger
d076da7e89
Rollup merge of #149647 - reddevilmidzy:test, r=Kivooeo
Add regression test for 141845

close: rust-lang/rust#141845

I saw the `tests/ui/associated-inherent-types` directory, but I felt the current location was a better fit.
2025-12-05 16:17:11 +01:00
Matthias Krüger
0c05bb5606
Rollup merge of #149630 - wafarm:fix-149604, r=JonathanBrouwer
Check identifiers defined in macros when suggesting identifiers hidden by hygiene

Fix rust-lang/rust#149604

r? `@JonathanBrouwer` (Since you reviewed the other one related to this)
2025-12-05 16:17:10 +01:00
Matthias Krüger
c42ce16c7b
Rollup merge of #149548 - aerooneqq:ice-issue-144594, r=petrochenkov
Generate delegation error body when delegation is not resolved

This PR relates to the delegation feature rust-lang/rust#118212, it fixes rust-lang/rust#144594 ICE.
r? `@petrochenkov`
2025-12-05 16:17:10 +01:00
Matthias Krüger
c7889581ca
Rollup merge of #149547 - tgross35:range-iterators, r=joboet
library: Rename `IterRange*` to `Range*Iter`

There is a weak convention in the ecosystem that `IterFoos` is an iterator yielding items of type `Foo` (e.g. `bitflags` `IterNames`, `hashbrown` `IterBuckets`), while `FooIter` is an iterator over `Foo` from an `.iter()` or `.into_iter()` method (e.g. `memchr` `OneIter`, `regex` `SetMatchesIter`). Rename `IterRange`, `IterRangeInclusive`, and `IterRangeFrom` to `RangeIter`, `RangeInclusiveIter`, and `RangeInclusiveIter` to match this.

Tracking issue: https://github.com/rust-lang/rust/issues/125687 (`new_range_api`)
2025-12-05 16:17:09 +01:00
Matthias Krüger
60be663188
Rollup merge of #149477 - RalfJung:minimum-maximum, r=tgross35
float::maximum/minimum: make docs more streamlined

This does with `maximum`/`minimum` what https://github.com/rust-lang/rust/pull/149475 did with `max`/`min`: first a self-contained description of the semantics, then comparing with other operations. It also makes the wording consistent with those other functions. Previously we had some of the semantics below the examples for some reason, and we repeated "If one of the arguments is NaN, then NaN is returned"; that has been streamlined as well.

r? `@tgross35`
2025-12-05 16:17:08 +01:00
Matthias Krüger
7850fc4b13
Rollup merge of #149101 - reddevilmidzy:mutable, r=eholk
Improve mutable-binding suggestion to include name

resolve: rust-lang/rust#148467
2025-12-05 16:17:07 +01:00
Matthias Krüger
a308ab8879
Rollup merge of #148811 - Paladynee:doc/location-caller-updated, r=joboet
core docs: rewrite `panic::Location::caller` with visual line/column numbers

no tracking issue

hey, this is my first PR on rust-lang/rust, so hopefully everything goes well.

i noticed the documentation for `core::panic::Location::caller` was kind of unintelligible (and maybe even wrong due to standalone_crate) and filled with magic numbers, so i provided line and column numbers as a visual guidance as to how it should be used.

edit: uh oh, looks like i pushed changes from random commits unrelated to me, what's going on?
edit2: reverted the unintended changes by this pr
2025-12-05 16:17:06 +01:00
Matthias Krüger
4d08c33fc1
Rollup merge of #148662 - leftmostcat:document-isize-limit, r=joboet
alloc: Document panics when allocations will exceed max

Document panics in `String` and `Vec` due to capacity overflowing `isize::MAX`. Correct outdated claims of `usize::MAX` limit.

Fixes https://github.com/rust-lang/rust/issues/148598.

Ping `@lolbinarycat`
2025-12-05 16:17:05 +01:00
aerooneqq
3e717121a1 Generate error delegation body when delegation is not resolved 2025-12-05 15:22:26 +03:00
bors
97b131c900 Auto merge of #148602 - BoxyUwU:coercion_cleanup_uncontroversial, r=lcnr
misc coercion cleanups and handle safety correctly

r? lcnr

### "remove normalize call"

Fixes rust-lang/rust#132765

If the normalization fails we would sometimes get a `TypeError` containing inference variables created inside of the probe used by coercion. These would then get leaked out causing ICEs in diagnostics logic

### "leak check and lub for closure<->closure coerce-lubs of same defids"

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/233
```rust
fn peculiar() -> impl Fn(u8) -> u8 {
    return |x| x + 1
}
```
the `|x| x + 1` expr has a type of `Closure(?31t)` which we wind up inferring the RPIT to. The `CoerceMany` `ret_coercion` for the whole `peculiar` typeck has an expected type of `RPIT` (unnormalized). When we type check the `return |x| x + 1` expr we go from the never type to `Closure(?31t)` which then participates in the `ret_coercion` giving us a `coerce-lub(RPIT, Closure(?31t))`.

Normalizing `RPIT` gives us some `Closure(?50t)` where `?31t` and `?50t` have been unified with `?31t` as the root var. `resolve_vars_if_possible` doesn't resolve infer vars to their roots so these wind up with different structural identities so the fast path doesn't apply and we fall back to coercing to a `fn` ptr. cc rust-lang/rust#147193 which also fixes this

New solver probably just gets more inference variables here because canonicalization + generally different approach to normalization of opaques. Idk :3

### FCP worthy stuffy

there are some other FCP worthy things but they're in my FCP comment which also contains some analysis of the breaking nature of the previously listed changes in this PR: https://github.com/rust-lang/rust/pull/148602#issuecomment-3503497467
2025-12-05 11:46:41 +00:00
Ralf Jung
f040a1a915 interpret: test SNaN handling of float min/max and update comments 2025-12-05 08:53:42 +01:00
Zalathar
84ff44c749 Add perma-unstable --print=backend-has-zstd for use by compiletest
Tests for `-Zdebuginfo-compression=zstd` need to be skipped if LLVM was built
without support for zstd compression.

Currently, compiletest relies on messy and fragile heuristics to detect whether
the compiler's LLVM was built with zstd support. But the compiler itself
already knows whether LLVM has zstd or not, so it's easier for compiletest to
just ask the compiler.
2025-12-05 14:27:52 +11:00
bors
864339abf9 Auto merge of #149653 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac
2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000
- fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915)
- Remove legacy tmpdir support (rust-lang/cargo#16342)
- Run clippy CI on more targets (rust-lang/cargo#16340)
- feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309)
- fix(timings): unlocked -&gt; unblocked (rust-lang/cargo#16337)
- fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335)
- fix(frontmatter): Restrict code fence length  (rust-lang/cargo#16334)
- Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333)
- fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331)

This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
2025-12-05 01:24:59 +00:00
bors
3e2dbcdd3a Auto merge of #149646 - matthiaskrgr:rollup-jbfeow8, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#147224 (Emscripten: Turn wasm-eh on by default)
 - rust-lang/rust#149405 (Recover on misspelled item keyword)
 - rust-lang/rust#149443 (Tidying up UI tests [6/N])
 - rust-lang/rust#149524 (Move attribute safety checking to attribute parsing)
 - rust-lang/rust#149593 (powf, powi: point out SNaN non-determinism)
 - rust-lang/rust#149605 (Use branch name instead of HEAD when unshallowing)
 - rust-lang/rust#149612 (Apply the `bors` environment also to the `outcome` job)
 - rust-lang/rust#149623 (Don't require a normal tool build of clippy/rustfmt when running their test steps)
 - rust-lang/rust#149627 (Point to the item that is incorrectly annotated with `#[diagnostic::on_const]`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-04 22:04:03 +00:00
Alina Sbirlea
ad73972e99 Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.
LLVM reference commit:
04c81a9973.
2025-12-04 20:23:00 +00:00
Weihang Lo
d898b568d3
Update cargo submodule 2025-12-04 13:10:02 -05:00
bors
b33119ffdd Auto merge of #149642 - GuillaumeGomez:subtree-update_cg_gcc_2025-12-04, r=GuillaumeGomez
cg_gcc subtree update

cc `@antoyo`

r? ghost
2025-12-04 17:48:32 +00:00
reddevilmidzy
3d0f5f2f88 Add regression test for 141845 2025-12-05 00:39:55 +09:00
Matthias Krüger
69f8a5ca67
Rollup merge of #149627 - lapla-cogito:diag_onconst, r=jdonszelmann
Point to the item that is incorrectly annotated with `#[diagnostic::on_const]`

close rust-lang/rust#149606

r? estebank
2025-12-04 16:07:57 +01:00
Matthias Krüger
f2d4955335
Rollup merge of #149623 - jieyouxu:redundant-tool-test-step, r=Zalathar
Don't require a normal tool build of clippy/rustfmt when running their test steps

This is redundant and wasteful.

Noticed in https://github.com/rust-lang/rust/pull/147372#discussion_r2585886897.
2025-12-04 16:07:56 +01:00
Matthias Krüger
2878757d4e
Rollup merge of #149612 - Kobzol:environment-bors-toolstate, r=ehuss
Apply the `bors` environment also to the `outcome` job

To fix passing the toolstate token to `publish_toolstate.sh`. Found in https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/TOOLSTATE_REPO_ACCESS_TOKEN/with/561580948.

r? ehuss
2025-12-04 16:07:56 +01:00
Matthias Krüger
f610f0568a
Rollup merge of #149605 - Kobzol:unshalllow-beta, r=cuviper
Use branch name instead of HEAD when unshallowing

Fixes a regression with the beta channel that was discovered in https://github.com/rust-lang/rust/pull/149572.

r? `@cuviper`
2025-12-04 16:07:55 +01:00
Matthias Krüger
364b20e5f8
Rollup merge of #149593 - RalfJung:pow-nondet, r=Amanieu
powf, powi: point out SNaN non-determinism

The non-determinism has two sources:
- LLVM reserves the right to treat signaling NaNs as-if they were quiet, so it may fold `powf(x, 0)` to `1` even if `x` might be a signaling NaN.
- Some libm `pow` implementations (e.g. the one in musl) don't implement the signaling NaN special-case. See https://rust.godbolt.org/z/chsbv5v4d.

Cc `@tgross35` `@Amanieu`
2025-12-04 16:07:54 +01:00
Matthias Krüger
0c95abb979
Rollup merge of #149524 - JonathanBrouwer:move_attr_safety, r=jdonszelmann
Move attribute safety checking to attribute parsing

This PR moves attribute safety checking to be done during attribute parsing. The `cfg` and `cfg_attr` attribute no longer need special-cased safety checking, yay!

This PR is a part 1 of 2, in the second part I'd like to define attribute safety in the attribute parsers rather than getting the information from BUILTIN_ATTRIBUTE_MAP, but to keep PRs reviewable lets do that separately.

Fixes https://github.com/rust-lang/rust/issues/148453 by reordering the diagnostics. The "cannot find attribute" diagnostic now appears first, but both diagnostics still appear.

r? `@jdonszelmann`
2025-12-04 16:07:53 +01:00
Matthias Krüger
fa79ba65c5
Rollup merge of #149443 - reddevilmidzy:t6, r=Kivooeo
Tidying up UI tests [6/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895

removed directory  `tests/ui/trait-objects`,  `tests/ui/for`, `tests/ui/warnings`

`trait-objects` -> `traits/object`
`for` -> `for-loop-while` (except `for/issue-20605.rs` test. this relocated to `traits/dyn-iterator-deref-in-for-loop.rs`)
`warnings` -> `resolve`, `entry-point`

r? Kivooeo
2025-12-04 16:07:53 +01:00
Matthias Krüger
55fa9f74db
Rollup merge of #149405 - scrabsha:push-tzonpluy, r=jdonszelmann
Recover on misspelled item keyword

the title says everything. first commit adds a test that shows how current `main` behaves on misspelled item keyword. second commit adds the recovery, which allows to emit many more errors.
2025-12-04 16:07:52 +01:00
Matthias Krüger
c80ac0f21a
Rollup merge of #147224 - hoodmane:wasm-eh-default-on, r=bjorn3
Emscripten: Turn wasm-eh on by default

As specified by [MCP](https://github.com/rust-lang/compiler-team/issues/920)
Resolves https://github.com/rust-lang/rust/issues/148309
Resolves https://github.com/rust-lang/rust/issues/112195
2025-12-04 16:07:51 +01:00
bors
29e035e172 Auto merge of #149632 - matthiaskrgr:rollup-c5iqgtn, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#149521 (Improve `io::Error::downcast`)
 - rust-lang/rust#149544 (Only apply `no_mangle_const_items`'s suggestion to plain const items)
 - rust-lang/rust#149545 (fix the check for which expressions read never type)
 - rust-lang/rust#149570 (rename cortex-ar references to unified aarch32)
 - rust-lang/rust#149574 (Batched compiletest Config fixups)
 - rust-lang/rust#149579 (Motor OS: fix compile error)
 - rust-lang/rust#149595 (Tidying up `tests/ui/issues` tests [2/N])
 - rust-lang/rust#149597 (Revert "implement and test `Iterator::{exactly_one, collect_array}`")
 - rust-lang/rust#149608 (Allow PowerPC spe_acc as clobber-only register)
 - rust-lang/rust#149610 (Implement benchmarks for uN::{gather,scatter}_bits)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-04 14:38:19 +00:00
Guillaume Gomez
94f1bfe1fc Merge commit 'dab6863ce8' into subtree-update_cg_gcc_2025-12-04 2025-12-04 14:53:08 +01:00
bors
5372fc9cb7 Auto merge of #149586 - tgross35:update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to acb3a0074d.

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

r? `@ghost`
2025-12-04 11:28:11 +00:00
Matthias Krüger
ac607e0d91
Rollup merge of #149610 - quaternic:gather-scatter-bits-bench, r=Mark-Simulacrum
Implement benchmarks for uN::{gather,scatter}_bits

Feature gate: #![feature(uint_gather_scatter_bits)]
Tracking issue: https://github.com/rust-lang/rust/issues/149069
Accepted ACP: https://github.com/rust-lang/libs-team/issues/695#issuecomment-3549284861

For each method, there are three benchmarks, which differ in that the mask (second) argument is one of:
 - constant at compile time
 - runtime value but invariant for the measured loop
 - different for each call

Sample output
```text
    num::int_bits::u32::constant::gather_bits      555.82ns/iter   +/- 22.41
    num::int_bits::u32::constant::scatter_bits     545.45ns/iter  +/- 124.26
    num::int_bits::u32::invariant::gather_bits    8178.86ns/iter  +/- 217.37
    num::int_bits::u32::invariant::scatter_bits   7135.95ns/iter  +/- 214.51
    num::int_bits::u32::variable::gather_bits    10539.29ns/iter  +/- 198.90
    num::int_bits::u32::variable::scatter_bits    9671.26ns/iter  +/- 254.88
```
(and similarly for the other `uN` types)
2025-12-04 09:22:16 +01:00
Matthias Krüger
5c4915734d
Rollup merge of #149608 - pmur:murp/ppc-clobber-speacc, r=Amanieu
Allow PowerPC spe_acc as clobber-only register

This register is only supported on the *powerpc*spe targets. It is only recognized by LLVM. gcc does not accept this as a clobber, nor does it support these targets.

This is a volatile register, thus it is included with clobber_abi.

r? `@Amanieu`
r? `@antoyo`
2025-12-04 09:22:15 +01:00