Commit graph

316245 commits

Author SHA1 Message Date
Josh Stone
764ac2b84f relnotes: fix 1.93's as_mut_array methods
The links are correct, but text typoed `as_array_mut`.
2026-01-23 15:54:13 -08:00
bors
d222ddc4d9 Auto merge of #151501 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? Manishearth 

`Cargo.lock` update due to Clippy version bump.
2026-01-23 14:57:31 +00:00
Philipp Krones
2a62479677
bootstrap: fix Clippy warning 2026-01-23 13:46:30 +01:00
bors
5944b12bd4 Auto merge of #151533 - JonathanBrouwer:rollup-P3oXrte, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#149639 (inline constant localized typeck constraint computation)
 - rust-lang/rust#150780 (Add -Z large-data-threshold)
 - rust-lang/rust#151520 (Rename `HandleCycleError` to `CycleErrorHandling`)
 - rust-lang/rust#151525 (update enzyme, includes an extra patch to fix MacOS builds in CI)
 - rust-lang/rust#151527 (Clean up or resolve cfg-related instances of `FIXME(f16_f128)`)

r? @ghost
2026-01-23 10:48:41 +00:00
Jonathan Brouwer
48b9a6c298
Rollup merge of #151527 - tgross35:f16-fixme-cleanup, r=folkertdev
Clean up or resolve cfg-related instances of `FIXME(f16_f128)`

* Replace target-specific config that has a `FIXME` with `cfg(target_has_reliable_f*)`
* Take care of trivial intrinsic-related FIXMEs
* Split `FIXME(f16_f128)` into `FIXME(f16)`, `FIXME(f128)`, or `FIXME(f16,f128)` to more clearly identify what they block

The individual commit messages have more details.
2026-01-23 11:07:57 +01:00
Jonathan Brouwer
fe07e747d9
Rollup merge of #151525 - ZuseZ4:update-enzyme-jan-22, r=Kobzol
update enzyme, includes an extra patch to fix MacOS builds in CI

I updated the submodule under rust-lang/enzyme to match EnzymeAD/enzyme, and added one commit, which based on some testing should fix how we build Enzyme in the MacOS CI. Once this pr landed, we will verify again that CI still works, and afterwards upstream the patch and drop it from our fork. No new test failures.

cc @sgasho

r? @Kobzol
2026-01-23 11:07:56 +01:00
Jonathan Brouwer
730591cee4
Rollup merge of #151520 - Zalathar:cycle-error-handling, r=Kivooeo
Rename `HandleCycleError` to `CycleErrorHandling`

In https://github.com/rust-lang/rust/pull/101303, the `handle_cycle_error` field was changed from a macro-generated closure to a macro-selected enum variant. But it was not renamed to reflect the fact that it now holds data, not code.

Renaming the field and its associated enum to `cycle_error_handling: CycleErrorHandling` should make the relevant code less confusing to read.

This PR also moves the enum out of `rustc_query_system::error`, where it was easily confused with diagnostic structs.

There should be no change to compiler behaviour.
2026-01-23 11:07:56 +01:00
Jonathan Brouwer
dec8d6ebcf
Rollup merge of #150780 - fzakaria:fzakaria/section-threshold, r=jackh726
Add -Z large-data-threshold

This flag allows specifying the threshold size for placing static data in large data sections when using the medium code model on x86-64.

When using -Ccode-model=medium, data smaller than this threshold uses RIP-relative addressing (32-bit offsets), while larger data uses absolute 64-bit addressing. This allows the compiler to generate more efficient code for smaller data while still supporting data larger than 2GB.

This mirrors the -mlarge-data-threshold flag available in GCC and Clang. The default threshold is 65536 bytes (64KB) if not specified, matching LLVM's default behavior.
2026-01-23 11:07:55 +01:00
Jonathan Brouwer
ae31dd7b28
Rollup merge of #149639 - lqd:fix-typeck-constraints, r=jackh726
inline constant localized typeck constraint computation

This fixes an oversight in the previous PRs, this constraint is local to a point (and liveness does the rest) and so has a fixed direction.

I wasn't planning on trying to improve the impl for perf, versus computing loan liveness without first unifying the cfg and subset graph, but it's like a 20x improvement for typeck constraints on wg-grammar (-15% end-to-end) for a trivial fix.

r? @jackh726

In general, I want to cleanup these edges to avoid off-by-one errors in constraints at effectful statements and ensure the midpoint-avoidance strategy is sound and works well, in particular with respect to edges that flow backwards from the result into its inputs. But I'd like to start from something that passes all tests and is simpler, because the eventual solution may
1. involve localizing these edges differently than *separate* liveness and typeck lowering passes/approaches, which would need to be lowered at the same time for example. I'm already doing the latter in the loan liveness rewrite as part of creating edges on-demand during traversal, and this new structure would be a better fit to verify, or fix, these subtle edges.
2. also require changes in MIR typeck to track the flow across points more precisely, and I don't know how hard that would be. *Computing* the constraint direction is currently a workaround for that.

Therefore, in a future PR, I'll also remove this computation from the terminator constraints, but I can also do that in this PR if you'd prefer.
2026-01-23 11:07:55 +01:00
bors
9283d592de Auto merge of #151389 - scottmcm:vec-repeat, r=joboet
Use `repeat_packed` when calculating layouts in `RawVec`

Seeing whether this helps the icounts seen in https://github.com/rust-lang/rust/pull/148769#issuecomment-3769921666
2026-01-23 07:24:11 +00:00
Trevor Gross
490b307740 cleanup: Start splitting FIXME(f16_f128) into f16, f128, or f16,f128
Make it easier to identify which FIXMEs are blocking stabilization of
which type.
2026-01-22 23:41:57 -06:00
Trevor Gross
e035c770f2 library: Use fabsf128 in the implementation of abs
This FIXME was introduced in 6e2d934a88 ("Add more `f16` and `f128`
library functions and constants") but I can't actually find my
reasoning. As far as I can tell, LLVM has been lowering `fabs.f128` as
bitwise operations for a while across all targets so there shouldn't be
a problem here.

Thus, apply what is suggested in the FIXME.
2026-01-22 23:41:57 -06:00
Trevor Gross
12a03caf07 library: Resolve outdated FIXMEs related to float bitcasts in const 2026-01-22 23:41:57 -06:00
Trevor Gross
8840409f7a f16,f128: Resolve cfg-releated instances of FIXME(f16_f128)
There are a number of instances of `FIXME(f16_f128)` related to target
configuration; either these could use `target_has_reliable_f128`, or the
FIXME is describing such a cfg and is thus redundant (since any
`cfg(target_has_reliable_f*)` needs to be removed before stabilization
anyway).

Switch to using `target_has_reliable_*` where applicable and remove the
redundant FIXMEs.
2026-01-22 23:41:57 -06:00
bors
165591238e Auto merge of #151521 - jhpratt:rollup-PFh8sRJ, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#151450 (std: use `clock_nanosleep` for `sleep` where available)
 - rust-lang/rust#151494 (std: ensure that the deadline has passed in `sleep_until`)
 - rust-lang/rust#151498 (global.rs: improve readability of re-entrance section)
 - rust-lang/rust#151504 (Reorganizing tests/ui/issues 11 tests [3/N])

r? @ghost
2026-01-23 04:07:21 +00:00
Manuel Drehwald
ac533e25db update enzyme, includes an extra patch to fix MacOS builds in CI 2026-01-22 20:01:05 -08:00
Zalathar
ff331d2cc8 Rename HandleCycleError to CycleErrorHandling 2026-01-23 13:58:17 +11:00
Jacob Pratt
3086257204
Rollup merge of #151504 - zedddie:m10t, r=Kivooeo
Reorganizing tests/ui/issues 11 tests [3/N]

part of https://github.com/rust-lang/rust/issues/133895

r? Kivooeo
2026-01-22 20:16:52 -05:00
Jacob Pratt
0b334b84a0
Rollup merge of #151498 - tshepang:patch-1, r=jhpratt
global.rs: improve readability of re-entrance section
2026-01-22 20:16:51 -05:00
Jacob Pratt
15ce06c931
Rollup merge of #151494 - joboet:sleep_until_ensure_elapsed, r=jhpratt
std: ensure that the deadline has passed in `sleep_until`

The clock source used for `sleep` might not be the same as the one used for `Instant`, so the implementation of `sleep_until` may not assume that the `Instant` has elapsed. This is particularly relevant on Windows, where [`QueryPerformanceCounter`](https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter) is used for `Instant`, but [`SetWaitableTimer`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer) is (probably[^1]) based on [`QueryUnbiasedInterruptTimePrecise`](https://learn.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttimeprecise). If these clocks drift apart, the `sleep` might return before the deadline has passed.

Thus, this PR makes `sleep_until` recheck the current time after waking up and restart the `sleep` if necessary.

[^1]: The documentation doesn't specify a clock, but `QueryUnbiasedInterruptTimePrecise` uses the same units and doesn't count time during sleep either, so I'd wager it's what is used for the timer.
2026-01-22 20:16:51 -05:00
Jacob Pratt
d2acb11cd0
Rollup merge of #151450 - joboet:sleep_clock_monotonic, r=Amanieu
std: use `clock_nanosleep` for `sleep` where available

`nanosleep` is specified to use `CLOCK_REALTIME` but the documentation (especially the example) for `sleep` imply that it measures time using `Instant`, which uses `CLOCK_MONOTONIC`. Thus, this PR makes `sleep` use a relative `clock_nanosleep` with `CLOCK_MONOTONIC` where available. This doesn't make a difference for Linux (which uses `CLOCK_MONOTONIC` for `nanosleep` anyway) but is relevant for e.g. FreeBSD.

This also restores nanosecond-sleep precision for WASI, since https://github.com/rust-lang/rust/issues/150290 was caused by `nanosleep` internally using `clock_nanosleep` with `CLOCK_REALTIME` which is unsupported on WASIp2.

CC @alexcrichton for the WASI fix
2026-01-22 20:16:50 -05:00
bors
d10ac47c20 Auto merge of #151506 - JonathanBrouwer:rollup-MDuFdim, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#151412 (diagnostics: suggest deriving Default for enums)
 - rust-lang/rust#151495 (Fix ICE when using zero-length SIMD type in extern static)
 - rust-lang/rust#151497 (Fix typo: 'recieve' -> 'receive' in lldb-visualizers.md)

r? @ghost
2026-01-22 21:26:11 +00:00
Jonathan Brouwer
04246defca
Rollup merge of #151497 - bodhisilberling-2027:fix-typo-recieve-receive, r=tshepang
Fix typo: 'recieve' -> 'receive' in lldb-visualizers.md
2026-01-22 20:42:12 +01:00
Jonathan Brouwer
cbab2f0237
Rollup merge of #151495 - enthropy7:fix-simd-zero-length-extern-static, r=JonathanBrouwer
Fix ICE when using zero-length SIMD type in extern static

before my fix using a zero-length SIMD type in an extern static would cause an internal compiler error. now it properly shows a diagnostic error instead of panicking. it was because `LayoutError::InvalidSimd` wasn't handled in `check_static_inhabited` and fell through to a generic `delayed_bug`.

i added handling for `InvalidSimd` in `check_static_inhabited` (similar to `SizeOverflow`): when a SIMD type has an invalid layout, we call `emit_err` with `Spanned` to emit a normal error instead of an ICE. compiler now emits a clear error `"the SIMD type Simd<u8, 0> has zero elements"` with the correct span on the type, matching expected compiler behavior.

fixes rust-lang/rust#151451
2026-01-22 20:42:11 +01:00
Jonathan Brouwer
a2c53d6e4b
Rollup merge of #151412 - WhyNovaa:diagnostics-impl-enum-fix, r=lcnr
diagnostics: suggest deriving Default for enums

Fixing outdated code: now we can derive Default for enums

r? @lcnr
2026-01-22 20:42:10 +01:00
zedddie
2dbcc72d85
clean up some tests 2026-01-22 19:50:00 +01:00
zedddie
3815b05ccd
move some tests 2026-01-22 19:50:00 +01:00
enthropy7
b97036628f
Fix ICE when using zero-length SIMD type in extern static
Previously, using a zero-length SIMD type in an extern static would
cause an internal compiler error. Now it properly emits a diagnostic
error instead of panicking.
2026-01-22 21:16:34 +03:00
bors
39052daf93 Auto merge of #149440 - chenyukang:yukang/issue-149402, r=fee1-dead
Remove suggestion from importing unstable items on stable channel

Fixes rust-lang/rust#149402
2026-01-22 18:09:51 +00:00
Philipp Krones
e2d6de7b20
Update Cargo.lock 2026-01-22 19:03:11 +01:00
Philipp Krones
0e8e621b6a
Merge commit '54482290b5' into clippy-subtree-update 2026-01-22 19:02:54 +01:00
Tshepang Mbambo
33514a8ec6
global.rs: improve readability of re-entrance section 2026-01-22 19:18:27 +02:00
Bodhi Silberling
8aa5d5aab7 Fix typo: 'recieve' -> 'receive' in lldb-visualizers.md 2026-01-22 09:01:30 -08:00
Philipp Krones
54482290b5
Rustup (#16438)
r? @ghost

changelog: none
2026-01-22 16:00:49 +00:00
Philipp Krones
0f9b027859
Bump Clippy version -> 0.1.95 2026-01-22 16:55:20 +01:00
Philipp Krones
21e84b5da8
Bump nightly version -> 2026-01-22 2026-01-22 16:55:13 +01:00
Philipp Krones
94fe3ddd93
Merge remote-tracking branch 'upstream/master' into rustup 2026-01-22 16:55:00 +01:00
joboet
978c5f567e
std: ensure that the deadline has passed in sleep_until 2026-01-22 16:51:40 +01:00
bors
0f145634fc Auto merge of #151490 - JonathanBrouwer:rollup-ovStnQE, r=JonathanBrouwer
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151001 (rustdoc: render doc(hidden) as a code attribute)
 - rust-lang/rust#151042 (fix fallback impl for select_unpredictable intrinsic)
 - rust-lang/rust#151220 (option: Use Option::map in Option::cloned)
 - rust-lang/rust#151260 (Handle unevaluated ConstKind in in_operand)
 - rust-lang/rust#151296 (MGCA: Fix incorrect pretty printing of valtree arrays)
 - rust-lang/rust#151423 (Move assert_matches to planned stable path)
 - rust-lang/rust#151441 (Fix ICE: Don't try to evaluate type_consts when eagerly collecting items)
 - rust-lang/rust#151465 (codegen: clarify some variable names around function calls)
 - rust-lang/rust#151468 (fix `f16` doctest FIXMEs)
 - rust-lang/rust#151469 (llvm: Tolerate dead_on_return attribute changes)
 - rust-lang/rust#151476 (Avoid `-> ()` in derived functions.)

r? @ghost
2026-01-22 14:53:11 +00:00
Jonathan Brouwer
d86afd2ec0
Rollup merge of #151476 - nnethercote:no-unit-ret-ty-in-derive, r=Kobzol
Avoid `-> ()` in derived functions.

`hash` and `assert_receiver_is_total_eq` have no return type. This commit removes the `-> ()` that is currently printed for them.

r? @Kobzol
2026-01-22 13:35:44 +01:00
Jonathan Brouwer
797601b84c
Rollup merge of #151469 - maurer:dead-on-return, r=nikic
llvm: Tolerate dead_on_return attribute changes

The attribute now has a size parameter and sorts differently. Adjust tests to tolerate this.

https://github.com/llvm/llvm-project/pull/171712

r? durin42

@rustbot label llvm-main
2026-01-22 13:35:43 +01:00
Jonathan Brouwer
4d631df8b4
Rollup merge of #151468 - folkertdev:f16-fixmes, r=tgross35
fix `f16` doctest FIXMEs

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

Remove a bunch of fixmes, and run docs tests on all targets that (should) support them.

r? tgross35
2026-01-22 13:35:43 +01:00
Jonathan Brouwer
704eaef9d4
Rollup merge of #151465 - RalfJung:fn-call-vars, r=mati865
codegen: clarify some variable names around function calls

I looked at rust-lang/rust#145932 to try to understand how it works, and quickly got lost in the variable names -- what refers to the caller, what to the callee? So here's my attempt at making those more clear. Hopefully the new names are correct.^^

Cc @JamieCunliffe
2026-01-22 13:35:42 +01:00
Jonathan Brouwer
5cccc7ca02
Rollup merge of #151441 - Keith-Cancel:mgca3, r=BoxyUwU
Fix ICE: Don't try to evaluate type_consts when eagerly collecting items

This fixes https://github.com/rust-lang/rust/issues/151246

The change is pretty straightforward if the Monomorphization strategy is eager which `-Clink-dead-code=true` sets. This then would lead to the existing code to try and evaluate a `type const` which does not have a body to evaluate leading to an ICE. The change is pretty straight forward just skip over type consts.

This also seems like a sensible choice to me since a MonoItem can only be a Fn, Static, or Asm. A type const is none of the aforementioned.

And even if it was added to the MonoItems list it would then later fail this check:
fe98ddcfcf/compiler/rustc_monomorphize/src/collector.rs (L438-L440)
Since that explicitly checks that the MonoItem's `DefKind` is static and not anything else.

One more change is the addition of a simple test of the example code from https://github.com/rust-lang/rust/issues/151246 that checks that code compiles successfully with `-Clink-dead-code=true`.

The only other change was to make the guard checks a little easier to read by making the logic more linear instead of one big if statement.

r? @BoxyUwU
@rustbot label +F-associated_const_equality +F-min_generic_const_args
2026-01-22 13:35:42 +01:00
Jonathan Brouwer
f03c1a2bd3
Rollup merge of #151423 - Voultapher:move-assert-matches, r=Amanieu
Move assert_matches to planned stable path

Another prep PR for https://github.com/rust-lang/rust/pull/137487
2026-01-22 13:35:41 +01:00
Jonathan Brouwer
96a40e9ac3
Rollup merge of #151296 - Human9000-bit:const-array-mir-dump-fix, r=BoxyUwU
MGCA: Fix incorrect pretty printing of valtree arrays

Fixes rust-lang/rust#151126

- **add failing test**
- **fix: additional check whether const array could be printed as raw bytes**

As I figured out, the problem was in `pretty_print_const_valtree`, where it tried to print unevaluated consts as if they were evaluated, which resulted in ICE.
2026-01-22 13:35:41 +01:00
Jonathan Brouwer
0fc86d8fa0
Rollup merge of #151260 - reddevilmidzy:type_const, r=BoxyUwU
Handle unevaluated ConstKind in in_operand

fix: rust-lang/rust#151248

r? BoxyUwU
~~I can't reproduce rust-lang/rust#151246 in my local(x86_64-pc-windows-msvc) even before this change. 🤔
create a draft and test it in different environments.~~
2026-01-22 13:35:40 +01:00
Jonathan Brouwer
4fb420afa5
Rollup merge of #151220 - cvengler:map-option, r=tgross35
option: Use Option::map in Option::cloned

This commit removes a repetitive match statement in favor of Option::map for Option::cloned.
2026-01-22 13:35:39 +01:00
Jonathan Brouwer
ddd8965d79
Rollup merge of #151042 - RedDaedalus:fix-select-unpredictable-fallback, r=RalfJung
fix fallback impl for select_unpredictable intrinsic

`intrinsics::select_unpredictable` does not drop the value that is not selected, but the fallback impl did not consider this behavior. This creates an observable difference between Miri and actual execution, and possibly does not play well with the `core::hint` version which has extra logic to drop the value that was not selected.
```rust
#![feature(core_intrinsics)]

fn main() {
    core::intrinsics::select_unpredictable(true, LoudDrop(0), LoudDrop(1));
    // cargo run: "0"; cargo miri run: "1 0"
}

struct LoudDrop(u8);

impl Drop for LoudDrop {
    fn drop(&mut self) {
        print!("{} ", self.0);
    }
}
```

This change let me remove the `T: [const] Destruct` bound as well, since the destructor is no longer relevant.
2026-01-22 13:35:39 +01:00
Jonathan Brouwer
83ffa35979
Rollup merge of #151001 - chojs23:fix/hidden-attr-docs, r=GuillaumeGomez
rustdoc: render doc(hidden) as a code attribute

Move `#[doc(hidden)]` into the shared code-attribute renderer so it matches the styling and placement of other attributes in rustdoc HTML.

Closes rust-lang/rust#132304
2026-01-22 13:35:38 +01:00