Commit graph

316344 commits

Author SHA1 Message Date
The Miri Cronjob Bot
3d87f9ce4e Merge ref '5a07626f4b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@5a07626f4b
Filtered ref: rust-lang/miri@cc208624ef
Upstream diff: d10ac47c20...5a07626f4b

This merge was created using https://github.com/rust-lang/josh-sync.
2026-01-25 05:13:36 +00:00
zakie
9e80b1ba7e Fix broken WASIp1 reference link 2026-01-25 17:24:08 +09:00
The Miri Cronjob Bot
ed44659973 Prepare for merging from rust-lang/rust
This updates the rust-version file to 5a07626f4b.
2026-01-25 05:05:35 +00:00
bors
5a07626f4b Auto merge of #151615 - matthiaskrgr:rollup-2WQ1USJ, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149962 (Promote powerpc64-unknown-linux-musl to tier 2 with host tools)
 - rust-lang/rust#150138 (Add new Tier 3 targets for ARMv6)
 - rust-lang/rust#150905 (Fix(lib/win/net): Remove hostname support under Win7)
 - rust-lang/rust#151094 (remote-test-server: Fix compilation on UEFI targets)
 - rust-lang/rust#151346 (add `simd_splat` intrinsic)
 - rust-lang/rust#151353 (compiletest: Make `aux-crate` directive explicitly handle `--extern` modifiers)
 - rust-lang/rust#151538 (std: `sleep_until` on Motor and VEX)
 - rust-lang/rust#151098 (Add Korean translation to Rust By Example)
 - rust-lang/rust#151157 (Extend build-manifest local test guide)
 - rust-lang/rust#151403 (std: use 64-bit `clock_nanosleep` on GNU/Linux if available)
 - rust-lang/rust#151571 (Fix cstring-merging test for Hexagon target)
2026-01-24 22:26:32 +00:00
Matthias Krüger
c11be675f4
Rollup merge of #151571 - androm3da:bcain/cstr_merge, r=tgross35
Fix cstring-merging test for Hexagon target

Hexagon assembler uses `.string` directive instead of `.asciz` for null-terminated strings. Both are equivalent but the test was only checking for `.asciz`.

Update the CHECK patterns to accept both directives using `.{{asciz|string}}` regex pattern.
2026-01-24 21:04:17 +01:00
Matthias Krüger
f6cc562026
Rollup merge of #151403 - joboet:clock_nanosleep_time64, r=Mark-Simulacrum
std: use 64-bit `clock_nanosleep` on GNU/Linux if available

glibc 2.31 added support for both 64-bit `clock_gettime` and 64-bit `clock_nanosleep`. Thus, if [`__clock_nanosleep_time64`](https://sourceware.org/git/?p=glibc.git;a=blob;f=include/time.h;h=22b29ca583549488a0e5395cb820f55ec6e38e5f;hb=e14a91e59d35bf2fa649a9726ccce838b8c6e4b7#l322) and the underlying syscall are available, use them for implementing `sleep_until` to avoid having to fall back to `nanosleep` for long-duration sleeps.
2026-01-24 21:04:17 +01:00
Matthias Krüger
9a06ab5ce7
Rollup merge of #151157 - Kobzol:build-manifest, r=Mark-Simulacrum
Extend build-manifest local test guide

Fill in more blanks about how to test build-manifest changes with Rustup.

Figured this out while working on https://github.com/rust-lang/rust/pull/151156, with the help of bjorn3.
2026-01-24 21:04:16 +01:00
Matthias Krüger
7dc32efb16
Rollup merge of #151098 - partrita:main, r=Mark-Simulacrum
Add Korean translation to Rust By Example

Hello,

I’ve added a Korean translation file to Rust By Example.
This contribution will help Korean readers learn Rust more easily by providing localized explanations and examples.

Please review the proposed additions when you have time.

Thanks in advance for your time and review! 🙏

Add Korean translation. Thanks in advance.
2026-01-24 21:04:16 +01:00
Matthias Krüger
275ffd55b5
Rollup merge of #151538 - joboet:sleep_more, r=Mark-Simulacrum
std: `sleep_until` on Motor and VEX

This PR:
* Forwards the public `sleep_until` to the private `sleep_until` on Motor OS
* Adds a `sleep_until` implementation on VEX that yields until the deadline has passed

CC @lasiotus
CC @lewisfm @tropicaaal @Gavin-Niederman @max-niederman
2026-01-24 21:04:16 +01:00
Matthias Krüger
0a1b437760
Rollup merge of #151353 - Enselic:aux-crate-opts, r=Zalathar
compiletest: Make `aux-crate` directive explicitly handle `--extern` modifiers

With `-Zunstable-options` it is possible to pass options to `--extern`. See here for an exhaustive list of possible options:
b5dd72d292/compiler/rustc_session/src/config.rs (L2356-L2367)

Using these options works with the `aux-crate` directive, but only because the options pretend to be part of the name. Make it clearer what `aux-crate` supports by explicitly handling `--extern` options.

This PR is step one of splitting up https://github.com/rust-lang/rust/pull/151258 into smaller pieces.

r? @Zalathar
2026-01-24 21:04:15 +01:00
Matthias Krüger
3a69035338
Rollup merge of #151346 - folkertdev:simd-splat, r=workingjubilee
add `simd_splat` intrinsic

Add `simd_splat` which lowers to the LLVM canonical splat sequence.

```llvm
insertelement <N x elem> poison, elem %x, i32 0
shufflevector <N x elem> v0, <N x elem> poison, <N x i32> zeroinitializer
```

Right now we try to fake it using one of

```rust
fn splat(x: u32) -> u32x8 {
    u32x8::from_array([x; 8])
}
```

or (in `stdarch`)

```rust
fn splat(value: $elem_type) -> $name {
    #[derive(Copy, Clone)]
    #[repr(simd)]
    struct JustOne([$elem_type; 1]);
    let one = JustOne([value]);
    // SAFETY: 0 is always in-bounds because we're shuffling
    // a simd type with exactly one element.
    unsafe { simd_shuffle!(one, one, [0; $len]) }
}
```

Both of these can confuse the LLVM optimizer, producing sub-par code. Some examples:

- https://github.com/rust-lang/rust/issues/60637
- https://github.com/rust-lang/rust/issues/137407
- https://github.com/rust-lang/rust/issues/122623
- https://github.com/rust-lang/rust/issues/97804

---

As far as I can tell there is no way to provide a fallback implementation for this intrinsic, because there is no `const` way of evaluating the number of elements (there might be issues beyond that, too). So, I added implementations for all 4 backends.

Both GCC and const-eval appear to have some issues with simd vectors containing pointers. I have a workaround for GCC, but haven't yet been able to make const-eval work. See the comments below.

Currently this just adds the intrinsic, it does not actually use it anywhere yet.
2026-01-24 21:04:15 +01:00
Matthias Krüger
99c44496ed
Rollup merge of #151094 - nicholasbishop:bishop-fix-server-uefi-compilation, r=Mark-Simulacrum
remote-test-server: Fix compilation on UEFI targets

Tested with:
./x build src/tools/remote-test-server --target x86_64-unknown-uefi
2026-01-24 21:04:14 +01:00
Matthias Krüger
fd5f48f559
Rollup merge of #150905 - PaulDance:patches/unsupport-win7-hostname, r=Mark-Simulacrum
Fix(lib/win/net): Remove hostname support under Win7

Fixes rust-lang/rust#150896. `GetHostNameW` is not available under Windows 7, leading to dynamic linking failures upon program executions. For now, as it is still unstable, this therefore appropriately cfg-gates the feature in order to mark the Win7 as unsupported with regards to this particular feature. Porting the functionality for Windows 7 would require changing the underlying system call and so more work for the immediate need.

@rustbot label C-bug O-windows-7 T-libs A-io
2026-01-24 21:04:14 +01:00
Matthias Krüger
00236a0d3d
Rollup merge of #150138 - thejpster:add-armv6-bare-metal, r=madsmtm,davidtwco,wesleywiser
Add new Tier 3 targets for ARMv6

Adds three new targets to support ARMv6 processors running bare-metal:

* `armv6-none-eabi` - Arm ISA, soft-float
* `armv6-none-eabihf` - Arm ISA, hard-float
* `thumbv6-none-eabi` - Thumb-1 ISA, soft-float

There is no `thumbv6-none-eabihf` target because as far as I can tell, hard-float isn't support with the Thumb-1 instruction set (and you need the ARMv6T2 extension to enable Thumb-2 support).

The targets require ARMv6K as a minimum, which allows the two Arm ISA targets to have full CAS atomics. LLVM has a bug which means it emits some ARMv6K instructions even if you only call for ARMv6, and as no-one else has noticed the bug, and because basically all ARMv6 processors have ARMv6K, I think this is fine. The Thumb target also doesn't have any kind of atomics, just like the Armv5TE and Armv4 targets, because LLVM was emitting library calls to emulate them.

Testing will be added to https://github.com/rust-embedded/aarch32 once the target is accepted. I already have tests for the other non-M arm-none-eabi targets, and those tests pass on these targets.

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I have listed myself. If accepted, I'll talk to the Embedded Devices Working Group about adding this one to the rosta with all the others they support.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

You might prefer `arm-none-eabi`, because `arm-unknown-linux-gnu` is an ARMv6 target - the implicit rule seems to be that if the Arm architecture version isn't specified, it's assumed to be v6. However, `armv6-none-eabi` seemed to fit better between `armv5te-none-eabi` and `armv7a/armv7r-none-eabi`.

The hamming distance between `thumbv6-none-eabi` and `thumbv6m-none-eabi` is unfortunately low, but I don't know how to make it better. They *are* the ARMv6 and ARMv6-M targets, and its perhaps not worse than `armv7a-none-eabi` and `armv7r-none-eabi`.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

No different to any other arm-none-eabi target.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

Noted.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate...

Same as other arm-none-eabi targets.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible.

Same as other arm-none-eabi targets.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

Noted.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

Noted

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

Noted
2026-01-24 21:04:13 +01:00
Matthias Krüger
df4fe869ce
Rollup merge of #149962 - Gelbpunkt:powerpc64-musl-tier-2, r=Mark-Simulacrum
Promote powerpc64-unknown-linux-musl to tier 2 with host tools

MCP: https://github.com/rust-lang/compiler-team/issues/946

Tested by compiling on an x86_64 host via `DEPLOY=1 ./src/ci/docker/run.sh dist-powerpc64-linux-musl` and running on Alpine Linux ppc64:

```
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# bash install.sh
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'rust-std-powerpc64-unknown-linux-musl'
install: installing component 'cargo'
install: installing component 'rustfmt-preview'
install: installing component 'rust-analyzer-preview'
install: installing component 'llvm-tools-preview'
install: installing component 'clippy-preview'
install: installing component 'miri-preview'
install: installing component 'rust-analysis-powerpc64-unknown-linux-musl'
install: installing component 'llvm-bitcode-linker-preview'

    rust installed.

root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# echo 'fn main() { println!("hello world"); }' > test.rs
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# which rustc
/usr/local/bin/rustc
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# rustc test.rs
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# ./test
hello world
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# file test
test: ELF 64-bit MSB pie executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-powerpc64.so.1, BuildID[sha1]=90a0fa543b3d42588ad32c5b858e56ac9c56faed, with debug_info, not stripped
```

I renamed the glibc job and created a new one for musl since the same is done for the little-endian targets.

Implements rust-lang/rust#149938

try-job: dist-powerpc64-linux-gnu
try-job: dist-powerpc64-linux-musl
2026-01-24 21:04:13 +01:00
bors
f134bbc78d Auto merge of #151544 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f
2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000
- chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548)
- Increase cache_lock test timeout (rust-lang/cargo#16545)
- iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506)
- chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543)
- test(build-std): adjust snapshot (rust-lang/cargo#16539)
- chore: bump to 0.96.0 (rust-lang/cargo#16538)
- fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221)
- fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535)
- fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536)
- feat(lints): Add non_kebab_case_bin lint  (rust-lang/cargo#16524)
- fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533)
- fix(patch): clean up patch-related error messages (rust-lang/cargo#16498)
- Store artifact deps in build unit dir (rust-lang/cargo#16519)
- refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
2026-01-24 19:11:57 +00:00
Jonathan 'theJPster' Pallant
7cc102a4ee Revised yield hints
Turns out v7 targets always have v6t2 set, so that line was redundant. Also add a link to the Arm Armv7 A.R.M.
2026-01-24 17:29:25 +00:00
Jonathan 'theJPster' Pallant
9d9870b735 Fix typo in thumbv4t/v5te README 2026-01-24 17:29:25 +00:00
Jonathan 'theJPster' Pallant
96897f016e Add ARMv6 bare-metal targets
Three targets, covering A32 and T32 instructions, and soft-float and
hard-float ABIs. Hard-float not available in Thumb mode. Atomics
in Thumb mode require __sync* functions from compiler-builtins.
2026-01-24 17:29:25 +00:00
Martin Nordholts
6f767b6860 compiletest: Make aux-crate directive explicitly handle --extern modifiers
To make it clearer what happens. In other words, do not silently keep
modifiers as part of `AuxCrate::name`.
2026-01-24 16:08:02 +01:00
bors
021fc25b7a Auto merge of #151594 - matthiaskrgr:rollup-sAb1Qar, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#149174 (`const` blocks as a `mod` item)
 - rust-lang/rust#151282 (THIR patterns: Explicitly distinguish `&pin` from plain `&`/`&mut`)
 - rust-lang/rust#151593 (miri subtree update)
 - rust-lang/rust#151516 (Do not emit errors on non-metaitem diagnostic attr input)

r? @ghost
2026-01-24 14:52:44 +00:00
Matthias Krüger
ac8e7f2548
Rollup merge of #151516 - mejrs:ignore_nonmeta, r=jdonszelmann,jonathanbrouwer
Do not emit errors on non-metaitem diagnostic attr input

This unblocks porting over diagnostic attributes by properly addressing https://github.com/rust-lang/rust/pull/151056#discussion_r2688179459

r? @JonathanBrouwer
2026-01-24 15:35:10 +01:00
Matthias Krüger
951113062c
Rollup merge of #151593 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to d4afb41d37.

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

r? @ghost
2026-01-24 15:35:09 +01:00
Matthias Krüger
a7249d87d8
Rollup merge of #151282 - Zalathar:pin-pat, r=Nadrieril
THIR patterns: Explicitly distinguish `&pin` from plain `&`/`&mut`

Currently, `thir::PatKind::Deref` is used for ordinary `&`/`&mut` patterns, and also for `&pin const` and `&pin mut` patterns under `feature(pin_ergonomics)`. The only way to distinguish between them is by inspecting the `Ty` attached to the pattern node.

That's non-obvious, making it easy to miss, and is also a bit confusing to read when it does occur.

This PR therefore adds an explicit `pin: hir::Pinnedness` field to `thir::PatKind::Deref`, to explicitly distinguish pin-deref nodes from ordinary builtin-deref nodes.

(I'm not deeply familiar with the future of pin-patterns, so I'm not sure whether that information is best carried as a field or as a separate `PatKind`, but I think this approach is at least an improvement over the status quo.)

r? Nadrieril (or compiler)
2026-01-24 15:35:09 +01:00
Matthias Krüger
0bb15457de
Rollup merge of #149174 - GrigorenkoPV:const_block_item, r=me,ytmimi
`const` blocks as a `mod` item

Tracking issue: rust-lang/rust#149226

This adds support for writing `const { ... }` as an item in a module. In the current implementation, this is a unique AST item that gets lowered to `const _: () = const { ... };` in HIR.

rustfmt support included.

TODO:
- `pub const { ... }` does not make sense (see rust-lang/rust#147136). Reject it. Should this be rejected by the parser or smth?
- Improve diagnostics (preferably they should not mention the fake `_` ident).
2026-01-24 15:35:08 +01:00
Ralf Jung
a3d2e99d13
Merge pull request #4818 from beepster4096/psuedohandling
windows shims: throw unsupported error for DuplicateHandle on pseudo handle
2026-01-24 11:25:57 +00:00
Ralf Jung
1046e2f06d
Merge pull request #4829 from RalfJung/readdir-special
readdir: also emit the special directory entries . and ..
2026-01-24 11:19:15 +00:00
Ralf Jung
7a937ae239 add test for DuplicateHandle on a pseudo handle 2026-01-24 11:56:39 +01:00
Ralf Jung
1d85118d90 readdir: also emit the special directory entries . and .. 2026-01-24 11:54:49 +01:00
bors
a18e6d9d14 Auto merge of #151575 - JonathanBrouwer:rollup-hPBbNPJ, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#150556 (Add Tier 3 Thumb-mode targets for Armv7-A, Armv7-R and Armv8-R)
 - rust-lang/rust#151259 (Fix is_ascii performance regression on AVX-512 CPUs when compiling with -C target-cpu=native)
 - rust-lang/rust#151500 (hexagon: Add HVX target features)
 - rust-lang/rust#151517 (Enable reproducible binary builds with debuginfo on Linux)
 - rust-lang/rust#151482 (Add "Skip to main content" link for keyboard navigation in rustdoc)
 - rust-lang/rust#151489 (constify boolean methods)
 - rust-lang/rust#151551 (Don't use default build-script fingerprinting in `test`)
 - rust-lang/rust#151555 (Fix compilation of std/src/sys/pal/uefi/tests.rs)

r? @ghost
2026-01-24 10:18:04 +00:00
beepster4096
3c03d82c84 error on DuplicateHandle of pseudo handle 2026-01-24 11:00:04 +01:00
Folkert de Vries
71f34429ac
const-eval: do not call immediate_const_vector on vector of pointers 2026-01-24 10:40:47 +01:00
Jonathan Brouwer
85430dfc90
Rollup merge of #151555 - nicholasbishop:bishop-fix-just-uefi-test, r=Ayush1325,tgross35
Fix compilation of std/src/sys/pal/uefi/tests.rs

Dropped the `align` test since the `POOL_ALIGNMENT` and `align_size` items it uses do not exist.

The other changes are straightforward fixes for places where the test code drifted from the current API, since the tests are not yet built in CI for the UEFI target.

CC @Ayush1325
2026-01-24 08:18:08 +01:00
Jonathan Brouwer
b6b11f473c
Rollup merge of #151551 - ehuss:test-build-script, r=jhpratt
Don't use default build-script fingerprinting in `test`

This changes the `test` build script so that it does not use the default fingerprinting mechanism in cargo which causes a full scan of the package every time it runs. This build script does not depend on any of the files in the package.

This is the recommended approach for writing build scripts.
2026-01-24 08:18:07 +01:00
Jonathan Brouwer
474c9fe9a4
Rollup merge of #151489 - bend-n:constify-all-boolean-methods-under-feature-gate-const-bool, r=jhpratt
constify boolean methods

```rs
// core::bool

impl bool {
    pub const fn then_some<T: [const] Destruct>(self, t: T) -> Option<T>;
    pub const fn then<T, F: [const] FnOnce() -> T + [const] Destruct>(self, f: F) -> Option<T>;
    pub const fn ok_or<E: [const] Destruct>(self, err: E) -> Result<(), E>;
    pub const fn ok_or_else<E, F: [const] FnOnce() -> E + [const] Destruct>;
}
```

will make tracking issue if pr liked
2026-01-24 08:18:07 +01:00
Jonathan Brouwer
ab0689919e
Rollup merge of #151482 - ThanhNguyxn:fix/rustdoc-skip-nav, r=GuillaumeGomez
Add "Skip to main content" link for keyboard navigation in rustdoc

## Summary

This PR adds a "Skip to main content" link for keyboard navigation in rustdoc, improving accessibility by allowing users to bypass the sidebar and navigate directly to the main content area.

## Changes

- **`src/librustdoc/html/templates/page.html`**: Added a skip link (`<a class="skip-main-content">`) immediately after the `<body>` tag that links to `#main-content`
- **`src/librustdoc/html/static/css/rustdoc.css`**: Added CSS styles for the skip link:
  - Visually hidden by default (`position: absolute; top: -100%`)
  - Becomes visible when focused via Tab key (`top: 0` on `:focus`)
  - Styled consistently with rustdoc theme using existing CSS variables
- **`tests/rustdoc-gui/skip-navigation.goml`**: Added GUI test to verify the skip link functionality

## WCAG Compliance

This addresses **WCAG Success Criterion 2.4.1 (Level A)** - Bypass Blocks:
> A mechanism is available to bypass blocks of content that are repeated on multiple web pages.

## Demo

When pressing Tab on a rustdoc page, the first focusable element is now the "Skip to main content" link, allowing keyboard users to jump directly to the main content without tabbing through the entire sidebar.

## Future Improvements

Based on the discussion in rust-lang/rust#151420, additional skip links could be added between the page summary and module contents sections. This PR provides the foundation, and we can iterate on adding more skip links based on feedback.

Fixes rust-lang/rust#151420

r? @JayanAXHF
2026-01-24 08:18:07 +01:00
Jonathan Brouwer
db8b9ecb5c
Rollup merge of #151517 - paradoxicalguy:enable-debuginfo-tests-linux, r=Kobzol
Enable reproducible binary builds with debuginfo on Linux

Fixes rust-lang/rust#89911

This PR enables `-Cdebuginfo=2` for binary crate types in the `reproducible-build` run-make test on Linux platforms.

- Removed the `!matches!(crate_type, CrateType::Bin)` check in `diff_dir_test()`
- SHA256 hashes match: `932be0d950f4ffae62451f7b4c8391eb458a68583feb11193dd501551b6201d4`

This scenario was previously disabled due to rust-lang/rust#89911. I have verified locally on Linux (WSL) with LLVM 21 that the regression reported in that issue appears to be resolved, and the tests now pass with debug info enabled.
2026-01-24 08:18:06 +01:00
Jonathan Brouwer
43b20c6abc
Rollup merge of #151500 - androm3da:bcain/hexagon_hvx_feat, r=folkertdev
hexagon: Add HVX target features

This will be used in order to emit HVX intrinsics
2026-01-24 08:18:06 +01:00
Jonathan Brouwer
13f0399a57
Rollup merge of #151259 - bonega:fix-is-ascii-avx512, r=folkertdev
Fix is_ascii performance regression on AVX-512 CPUs when compiling with -C target-cpu=native

## Summary

This PR fixes a severe performance regression in `slice::is_ascii` on AVX-512 CPUs when compiling with `-C target-cpu=native`.

On affected systems, the current implementation achieves only ~3 GB/s for large inputs, compared to ~60–70 GB/s previously (≈20–24× regression). This PR restores the original performance characteristics.

This change is intended as a **temporary workaround** for upstream LLVM poor codegen. Once the underlying LLVM issue is fixed and Rust is able to consume that fix, this workaround should be reverted.

  ## Problem

  When `is_ascii` is compiled with AVX-512 enabled, LLVM's auto-vectorization generates ~31 `kshiftrd` instructions to extract mask bits one-by-one, instead of using the efficient `pmovmskb`
  instruction. This causes a **~22x performance regression**.

  Because `is_ascii` is marked `#[inline]`, it gets inlined and recompiled with the user's target settings, affecting anyone using `-C target-cpu=native` on AVX-512 CPUs.

## Root cause (upstream)

The underlying issue appears to be an LLVM vectorizer/backend bug affecting certain AVX-512 patterns.

An upstream issue has been filed by @folkertdev  to track the root cause: llvm/llvm-project#176906

Until this is resolved in LLVM and picked up by rustc, this PR avoids triggering the problematic codegen pattern.

  ## Solution

  Replace the counting loop with explicit SSE2 intrinsics (`_mm_movemask_epi8`) that force `pmovmskb` codegen regardless of CPU features.

  ## Godbolt Links (Rust 1.92)

  | Pattern | Target | Link | Result |
  |---------|--------|------|--------|
  | Counting loop (old) | Default SSE2 | https://godbolt.org/z/sE86xz4fY | `pmovmskb` |
  | Counting loop (old) | AVX-512 (znver4) | https://godbolt.org/z/b3jvMhGd3 | 31x `kshiftrd` (broken) |
  | SSE2 intrinsics (fix) | Default SSE2 | https://godbolt.org/z/hMeGfeaPv | `pmovmskb` |
  | SSE2 intrinsics (fix) | AVX-512 (znver4) | https://godbolt.org/z/Tdvdqjohn | `vpmovmskb` (fixed) |

  ## Benchmark Results

  **CPU:** AMD Ryzen 5 7500F (Zen 4 with AVX-512)

  ### Default Target (SSE2) — Mixed

  | Size | Before | After | Change |
  |------|--------|-------|--------|
  | 4 B | 1.8 GB/s | 2.0 GB/s | **+11%** |
  | 8 B | 3.2 GB/s | 5.8 GB/s | **+81%** |
  | 16 B | 5.3 GB/s | 8.5 GB/s | **+60%** |
  | 32 B | 17.7 GB/s | 15.8 GB/s | -11% |
  | 64 B | 28.6 GB/s | 25.1 GB/s | -12% |
  | 256 B | 51.5 GB/s | 48.6 GB/s | ~same |
  | 1 KB | 64.9 GB/s | 60.7 GB/s | ~same |
  | 4 KB+ | ~68-70 GB/s | ~68-72 GB/s | ~same |

  ### Native Target (AVX-512) — Up to 24x Faster

  | Size | Before | After | Speedup |
  |------|--------|-------|---------|
  | 4 B | 1.2 GB/s | 2.0 GB/s | **1.7x** |
  | 8 B | 1.6 GB/s | 5.0 GB/s | **3.3x** |
  | 16 B | ~7 GB/s | ~7 GB/s | ~same |
  | 32 B | 2.9 GB/s | 14.2 GB/s | **4.9x** |
  | 64 B | 2.9 GB/s | 23.2 GB/s | **8x** |
  | 256 B | 2.9 GB/s | 47.2 GB/s | **16x** |
  | 1 KB | 2.8 GB/s | 60.0 GB/s | **21x** |
  | 4 KB+ | 2.9 GB/s | ~68-70 GB/s | **23-24x** |

  ### Summary

  - **SSE2 (default):** Small inputs (4-16 B) 11-81% faster; 32-64 B ~11% slower; large inputs unchanged
  - **AVX-512 (native):** 21-24x faster for inputs ≥1 KB, peak ~70 GB/s (was ~3 GB/s)

  Note: this is the pure ascii path, but the story is similar for the others.
  See linked bench project.

  ## Test Plan

  - [x] Assembly test (`slice-is-ascii-avx512.rs`) verifies no `kshiftrd` with AVX-512
  - [x] Existing codegen test updated to `loongarch64`-only (auto-vectorization still used there)
  - [x] Fuzz testing confirms old/new implementations produce identical results (~53M iterations)
  - [x] Benchmarks confirm performance improvement
  - [x] Tidy checks pass

  ## Reproduction / Test Projects

  Standalone validation tools: https://github.com/bonega/is-ascii-fix-validation

  - `bench/` - Criterion benchmarks for SSE2 vs AVX-512 comparison
  - `fuzz/` - Compares old/new implementations with libfuzzer

  ## Related Issues
  - issue opened by @folkertdev llvm/llvm-project#176906
  - Regression introduced in https://github.com/rust-lang/rust/pull/130733
2026-01-24 08:18:05 +01:00
Jonathan Brouwer
42c3cae5e7
Rollup merge of #150556 - thejpster:add-thumbv7a-thumbv7r-thumbv8r, r=petrochenkov
Add Tier 3 Thumb-mode targets for Armv7-A, Armv7-R and Armv8-R

We currently have targets for bare-metal Armv7-R, Armv7-A and Armv8-R, but only in Arm mode. This PR adds five new targets enabling bare-metal support on these architectures in Thumb mode.

This has been tested using https://github.com/rust-embedded/aarch32/compare/main...thejpster:aarch32:support-thumb-mode-v7-v8?expand=1 and they all seem to work as expected.

However, I wasn't sure what to do with the maintainer lists as these are five new targets, but they share the docs page with the existing Arm versions. I can ask the Embedded Devices WG Arm Team about taking on these ones too, but whether Arm themselves want to take them on I guess is a bigger question.
2026-01-24 08:18:05 +01:00
bors
87b2721871 Auto merge of #149848 - bjorn3:alloc_shim_rework2, r=jackh726
Use allocator_shim_contents in allocator_shim_symbols
2026-01-24 07:04:14 +00:00
Brian Cain
e558544565 Fix cstring-merging test for Hexagon target
Hexagon assembler uses `.string` directive instead of `.asciz` for
null-terminated strings. Both are equivalent but the test was only
checking for `.asciz`.

Update the CHECK patterns to accept both directives using
`.{{asciz|string}}` regex pattern.
2026-01-23 23:45:36 -06:00
joboet
dee0e39471
std: implement sleep_until on VEX 2026-01-23 23:15:12 +01:00
Nicholas Bishop
8995ff5ba8 Fix compilation of std/src/sys/pal/uefi/tests.rs
Dropped the `align` test since the `POOL_ALIGNMENT` and `align_size`
items it uses do not exist.

The other changes are straightforward fixes for places where the test
code drifted from the current API, since the tests are not yet built in
CI for the UEFI target.
2026-01-23 17:07:06 -05:00
Eric Huss
e38b55d0b7 Don't use default build-script fingerprinting in test
This changes the `test` build script so that it does not use the default
fingerprinting mechanism in cargo which causes a full scan of the
package every time it runs. This build script does not depend on any of
the files in the package.

This is the recommended approach for writing build scripts.
2026-01-23 11:10:53 -08:00
Ralf Jung
24ced66a96
Merge pull request #4821 from Islam-Imad/refactor/readdir
Unify  readdir across Unix targets and add test
2026-01-23 17:43:12 +00:00
Ralf Jung
4cd367f029 fix readdir on freebsd, and minor tweaks 2026-01-23 18:09:23 +01:00
Islam-Imad
b17a22f675 used readdir_r for mac OS
update .gitignore to ignore zed files
2026-01-23 18:09:23 +01:00
Islam-Imad
adeb4df788 Unify readdir shim across Unix targets and add test 2026-01-23 18:09:12 +01:00
Ralf Jung
3159e8053a
Merge pull request #4824 from Islam-Imad/test-libc-opendir-closedir
Add test for libc opendir and closedir
2026-01-23 16:30:54 +00:00