Commit graph

318678 commits

Author SHA1 Message Date
Jacob Pratt
c9a7f8afa9
Rollup merge of #152103 - eggyal:caught-divergence-not-unused, r=cjgillot
Consider captures to be used by closures that unwind

Assignments to a captured variable within a diverging closure should not be considered unused if the divergence is caught.

This patch considers such assignments/captures to be used by diverging closures irrespective of whether the divergence is caught, but better a false negative unused lint than a false positive one (the latter having caused a stable-to-stable regression).

Fixes rust-lang/rust#152079
r? compiler
2026-02-16 04:28:57 -05:00
Jacob Pratt
494c6da389
Rollup merge of #150601 - folkertdev:c-variadic-const-eval, r=RalfJung
support c-variadic functions in `rustc_const_eval`

tracking issue: https://github.com/rust-lang/rust/issues/44930

The new `GlobalAlloc::VaList` is used to create an `AllocId` that represents the variable argument list of a frame. The allocation itself does not store any data, all we need is the unique identifier.

The actual variable argument list is stored in `Memory`, and keyed by the `AllocId`. The `Frame` also stores this `AllocId`, so that when a frame is popped, it can deallocate the variable arguments.

At "runtime" a `VaList` value stores a pointer to the global allocation in its first bytes. The provenance on this pointer can be used to retrieve its `AllocId`, and the offset of the pointer is used to store the index of the next argument to read from the variable argument list.

Miri does not yet support `va_arg`, but I think that can be done separetely?

r? @RalfJung
cc @workingjubilee
2026-02-16 04:28:56 -05:00
Jacob Pratt
bff3e9edcc
Rollup merge of #148206 - xonx4l:deduplicate-float-tests, r=tgross35
Deduplicated float tests and unified in floats/mod.rs

In this PR Float tests are deduplicated and are unified in floats/mod.rs, as discussed in https://github.com/rust-lang/rust/issues/141726.

The moved float tests are:

-> test_powf
-> test_exp
-> test_exp2
-> test_ln
-> test_log_generic
-> test_log2
-> test_log10
-> test_asinh
-> test_acosh
-> test_atanh
-> test_gamma
-> test_ln_gamma

Closes: https://github.com/rust-lang/rust/issues/141726
2026-02-16 04:28:55 -05:00
Nicholas Nethercote
8d56cfe4c3 Move QuerySideEffect.
From `rustc_query_system` to `rustc_middle.` I put it in `graph.rs`,
it's one of two files that uses `QuerySideEffect` and seemed as good as
anywhere else.
2026-02-16 20:04:55 +11:00
Laurențiu Nicola
71c9411b19
Merge pull request #21653 from rust-lang/rustc-pull
minor: Rustc pull update
2026-02-16 09:03:05 +00:00
Nicholas Nethercote
72c7d8640f Remove rustc_query_system README file.
It's identical to the one in `rustc_query_impl`.
2026-02-16 19:58:18 +11:00
Jana Dönszelmann
12e6628977
Port rustc_nonnull_optimization_guaranteed to the new attribute parser 2026-02-16 09:46:04 +01:00
Jana Dönszelmann
47ca78040a
Port rustc_do_not_const_check to the new attribute parser 2026-02-16 09:38:31 +01:00
Ralf Jung
93d45480aa replace box_new in Box::new with write_via_move
requires lowering write_via_move during MIR building to make it just like an assignment
2026-02-16 08:44:56 +01:00
Zalathar
125e69e862 Suppress unstable-trait notes under -Zforce-unstable-if-unmarked 2026-02-16 17:19:05 +11:00
Zalathar
0f5c2215ad Regression test for "unstable" traits in force-unstable builds 2026-02-16 17:13:47 +11:00
The rustc-josh-sync Cronjob Bot
1fb6fc177f Merge ref '139651428d' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@139651428d
Filtered ref: rust-lang/rust-analyzer@3efb0c2db4
Upstream diff: ba284f468c...139651428d

This merge was created using https://github.com/rust-lang/josh-sync.
2026-02-16 04:54:45 +00:00
The rustc-josh-sync Cronjob Bot
2ef5156751 Prepare for merging from rust-lang/rust
This updates the rust-version file to 139651428d.
2026-02-16 04:49:19 +00:00
bors
fef627b1eb Auto merge of #152636 - nnethercote:big-cleanups, r=Zalathar
Big query system cleanups

Recent PRs have moved a lot of code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, where this code now has access to `TyCtxt`, e.g. rust-lang/rust#152419, rust-lang/rust#152516. As a result, a lot of abstraction and indirection that existed to work around this limitation is no longer necessary. This PR removes a lot of it.

r? @Zalathar
2026-02-16 04:20:25 +00:00
Zalathar
f1664acfbf Inline the is_tool check for setting -Zforce-unstable-if-unmarked 2026-02-16 12:35:00 +11:00
bors
139651428d Auto merge of #152452 - ShE3py:overruled-lint, r=BoxyUwU
feat: show what lint was overruled

We can't `#[allow]` a whole lint group if any of its members is forbidden, but the offending member is not currently shown if it was forbidden from the command line.

Before/after:
```diff
 $ rustc -F dead_code - <<< '#![allow(unused)]'
 error[E0453]: allow(unused) incompatible with previous forbid
  --> <anon>:1:10
   |
 1 | #![allow(unused)]
   |          ^^^^^^ overruled by previous forbid
   |
-  = note: `forbid` lint level was set on command line
+  = note: `forbid` lint level was set on command line (`-F dead_code`)
 
 error: aborting due to 1 previous error
```

@rustbot label +A-diagnostics +A-lints +D-terse
2026-02-15 20:05:05 +00:00
Folkert de Vries
981dacc34f
feature-gate c-variadic definitions and calls in const contexts 2026-02-15 19:54:25 +01:00
Trevor Gross
83794755b7 clif: Only set has_reliable_f128_math with glibc
New float tests in core are failing on clif with issues like the
following:

    Undefined symbols for architecture arm64:
        "_coshf128", referenced from:
            __RNvMNtCshY0fR2o0hOA_3std4f128C4f1284coshCs5TKtJxXQNGL_9coretests in coretests-e38519c0cc90db54.coretests.44b6247a565e10d1-cgu.10.rcgu.o
                "_exp2f128", referenced from:
            __RNvMNtCshY0fR2o0hOA_3std4f128C4f1284exp2Cs5TKtJxXQNGL_9coretests in coretests-e38519c0cc90db54.coretests.44b6247a565e10d1-cgu.10.rcgu.o
        ...

Disable f128 math unless the symbols are known to be available, which
for now is only glibc targets. This matches the LLVM backend.
2026-02-15 18:00:54 +00:00
xonx
2c1d605f21 unify and deduplicate floats 2026-02-15 18:00:41 +00:00
Ralf Jung
1f39d1f74f
Merge pull request #4859 from rust-lang/rustup-2026-02-15
Automatic Rustup
2026-02-15 17:52:14 +00:00
The Miri Cronjob Bot
702793191f fmt 2026-02-15 18:20:47 +01:00
bors
873b4beb0c Auto merge of #152671 - JonathanBrouwer:rollup-4Ov19Nw, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#152566 (Remove code for ThinLTO from cg_gcc)
 - rust-lang/rust#152278 (Fix const normalization for generic const items with trait assoc consts)
 - rust-lang/rust#152604 (Relocate some tests)
 - rust-lang/rust#152625 (Provide all lint group names to Clippy)
2026-02-15 16:52:45 +00:00
Chayim Refael Friedman
23a3e642d7
Merge pull request #21648 from alexanderkjall/borsh-error-compilation-failure
fix smol_str compilation error
2026-02-15 16:42:02 +00:00
Jonathan Brouwer
ee17e8cb7c
Rollup merge of #152625 - Alexendoo:lint-group-names, r=Kivooeo
Provide all lint group names to Clippy

Unblocks https://github.com/rust-lang/rust-clippy/pull/14689
2026-02-15 16:37:38 +01:00
Jonathan Brouwer
c5a12fbd0d
Rollup merge of #152604 - reddevilmidzy:refactor, r=Zalathar
Relocate some tests

`dynamically-sized-types` -> `dst`
`underscore-imports` -> `imports/underscore-imports`
`btreemap`, `hashmap` -> `collections/btreemap`, `collections/hashmap`
`higher-ranked-trait-bounds` -> `higher-ranked/trait-bounds`
`meta` -> `compiletest-self-test`, `bootstrap`

After the review, I'll squash.
2026-02-15 16:37:37 +01:00
Jonathan Brouwer
8b3ef9e0c7
Rollup merge of #152278 - lapla-cogito:type_const_nested, r=BoxyUwU
Fix const normalization for generic const items with trait assoc consts

In `try_fold_free_or_assoc`, the check for whether the normalization result needs further normalization only considered types, not constants. This caused generic const items marked with `#[type_const]` that reference trait associated consts to only partially normalize—the outer const would be expanded, but the inner associated const would remain unevaluated, resulting in an ICE in borrowck.

close rust-lang/rust#151647

r? BoxyUwU
(Based on git blame)
2026-02-15 16:37:37 +01:00
Jonathan Brouwer
4a4ea14148
Rollup merge of #152566 - bjorn3:cg_gcc_no_thin_lto, r=antoyo
Remove code for ThinLTO from cg_gcc

It was just a dummy implementation to workarround the fact that thin local lto is the default in rustc. By adding a thin_lto_supported thin local lto can be automatically disabled for cg_gcc, removing the need for this dummy implementation. This makes improvements to the LTO handling on the cg_ssa side a lot easier.

cc [#rustc-codegen-gcc > thin LTO implementation](https://rust-lang.zulipchat.com/#narrow/channel/386786-rustc-codegen-gcc/topic/thin.20LTO.20implementation/with/573625132)
This should make the work on https://github.com/rust-lang/compiler-team/issues/908 easier.

r? rust-lang/wg-gcc-backend
2026-02-15 16:37:36 +01:00
Lieselotte
d12923346c
feat: show what lint was overruled 2026-02-15 15:40:13 +01:00
Embers-of-the-Fire
d13828b2c7
fix: re-format the changes 2026-02-15 22:34:53 +08:00
Embers-of-the-Fire
a8bbacd270
fix: remove unused import 2026-02-15 22:26:54 +08:00
Chayim Refael Friedman
5ad533b09c
Merge pull request #21649 from Albab-Hasan/fix/assignment-rhs-never-coercion
fix: use `ExprIsRead::Yes` for rhs of ordinary assignments
2026-02-15 14:16:24 +00:00
Embers-of-the-Fire
40a3ca1189
fix: remove unused source span 2026-02-15 22:01:01 +08:00
bors
2219766af6 Auto merge of #152605 - scottmcm:box-drop-alignment, r=Mark-Simulacrum
Pass alignments through the shim as `Alignment` (not `usize`)

We're using `Layout` on both sides, so might as well skip the transmutes back and forth to `usize`.

The mir-opt test shows that doing so allows simplifying the boxed-slice drop slightly, for example.
2026-02-15 13:38:45 +00:00
THARUN
b55673bd76 Avoid ICE in From/TryFrom diagnostic under -Znext-solver 2026-02-15 19:02:44 +05:30
lapla
88f0ac34dc
Fix const normalization for generic const items with trait assoc consts 2026-02-15 22:05:27 +09:00
Mateusz Mikuła
b022e16e2a Install LLVM DLL in the right place on Windows
Unlike other systems, Windows requires runtime libraries to be present
in `PATH` or right next to the binary.

So, we copy the library next to the binary as the easier solution.
2026-02-15 13:13:27 +01:00
Albab-Hasan
7733f65ff9 fix: use ExprIsRead::Yes for rhs of ordinary assignments
the rhs of an ordinary assignment `x = *never_ptr` was inferred with
`ExprIsRead::No`, which prevented `NeverToAny` coercion for place
expressions of type `!`. this caused false type mismatches and missing
divergence detection. the destructuring assignment path and let binding
path both correctly use `ExprIsRead::Yes` for the rhs value, since the
value is always consumed (read). this makes the ordinary assignment path
consistent with both.
2026-02-15 17:37:51 +06:00
Chayim Refael Friedman
721edae2f9
Merge pull request #21647 from Albab-Hasan/fix/contains-explicit-ref-binding-missing-refmut
fix: handle `ref mut` bindings in `contains_explicit_ref_binding`
2026-02-15 11:36:30 +00:00
Jonathan Brouwer
dab350a3ed
Remove timing assertion from oneshot::send_before_recv_timeout 2026-02-15 12:32:17 +01:00
bjorn3
fa753a46c1 Remove code for ThinLTO from cg_gcc
It was just a dummy implementation to workarround the fact that thin
local lto is the default in rustc. By adding a thin_lto_supported thin
local lto can be automatically disabled for cg_gcc, removing the need
for this dummy implementation. This makes improvements to the LTO
handling on the cg_ssa side a lot easier.
2026-02-15 10:05:48 +00:00
bors
4c37f6d78c Auto merge of #152375 - Zoxc:rayon-scope-loops, r=jieyouxu,lqd
Use `scope` for `par_slice` instead of `join`

This uses `scope` instead of nested `join`s in `par_slice` so that each group of items are independent and do not end up blocking on another.
2026-02-15 09:55:40 +00:00
Alexander Kjäll
8d3b9f4a81
gate borsh tests on std also, as they depend on both 2026-02-15 10:28:47 +01:00
bors
ce0bf0b22b Auto merge of #152639 - jhpratt:rollup-sIUYGho, r=jhpratt
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#150424 (diagnostics: add note when param-env shadows global impl)
 - rust-lang/rust#152132 (implement `carryless_mul`)
 - rust-lang/rust#152508 (Improve write! and writeln! error when called without destination)
 - rust-lang/rust#152534 (Test(lib/win/net): Skip UDS tests when under Win7)
 - rust-lang/rust#152578 (ci: Lock cross toolchain version and update docs)
 - rust-lang/rust#152188 (Include `library/stdarch` for `CURRENT_RUSTC_VERSION` updates)
 - rust-lang/rust#152402 (Add regression test for rust-lang/rust#141738)
 - rust-lang/rust#152472 (unwind/wasm: fix compile error by wrapping wasm_throw in unsafe block)
 - rust-lang/rust#152610 (Exchange js_lint message between bless and non-bless)
2026-02-15 06:20:35 +00:00
The Miri Cronjob Bot
0f8640376d Merge ref '7bee525095' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@7bee525095
Filtered ref: rust-lang/miri@c878532787
Upstream diff: 47611e1604...7bee525095

This merge was created using https://github.com/rust-lang/josh-sync.
2026-02-15 05:26:41 +00:00
The Miri Cronjob Bot
d888b1c108 Prepare for merging from rust-lang/rust
This updates the rust-version file to 7bee525095.
2026-02-15 05:18:09 +00:00
reddevilmidzy
c92f384eb1 Move meta tests to compiletest-self-test, bootstrap dir 2026-02-15 04:43:02 +00:00
reddevilmidzy
86f1affe5a Move higher-ranked-trait-bounds tests into higher-ranked subdir 2026-02-15 04:39:21 +00:00
reddevilmidzy
863caf8b6b Move btreemap, hashmap tests into collections subdir 2026-02-15 04:39:13 +00:00
reddevilmidzy
1612988310 Move underscore-imports tests into imports subdir 2026-02-15 04:38:55 +00:00
reddevilmidzy
abca0d5f74 Move dynamically-sized-types tests into dst dir 2026-02-15 04:38:12 +00:00