Commit graph

316462 commits

Author SHA1 Message Date
Nikita Popov
3510a9ad0c Update to LLVM 22 2026-01-27 12:09:39 +01:00
bors
ebf13cca58 Auto merge of #151716 - Zalathar:rollup-kd2N5CM, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#147996 (Stabilize ppc inline assembly)
 - rust-lang/rust#148718 (Do not mention `-Zmacro-backtrace` for std macros that are a wrapper around a compiler intrinsic)
 - rust-lang/rust#151137 (checksum-freshness: Fix invalid checksum calculation for binary files)
 - rust-lang/rust#151680 (Update backtrace and windows-bindgen)
 - rust-lang/rust#150863 (Adds two new Tier 3 targets - `aarch64v8r-unknown-none{,-softfloat}`)
 - rust-lang/rust#151040 (Don't expose redundant information in `rustc_public`'s `LayoutShape`)
 - rust-lang/rust#151383 (remove `#[deprecated]` from unstable & internal `SipHasher13` and `24` types)
 - rust-lang/rust#151529 (lint: Use rustc_apfloat for `overflowing_literals`, add f16 and f128)
 - rust-lang/rust#151669 (rename uN::{gather,scatter}_bits to uN::{extract,deposit}_bits)
 - rust-lang/rust#151689 (Fix broken Xtensa installation link)
 - rust-lang/rust#151699 (Update books)
 - rust-lang/rust#151700 (os allow missing_docs)
2026-01-27 01:51:41 +00:00
Stuart Cook
2f8f4acbd6
Rollup merge of #151700 - lblasc:os-allow-missing-docs, r=tgross35
os allow missing_docs

Resolves rustc build faliure.

Discovered in https://github.com/NixOS/nixpkgs/pull/470993

```
rustc>  Documenting core v0.0.0 (/nix/var/nix/builds/nix-78118-1377149852/rustc-1.92.0-src/library/core)
rustc> error: missing documentation for a module
rustc>   --> library/core/src/os/mod.rs:13:1
rustc>    |
rustc> 13 | pub mod darwin {}
rustc>    | ^^^^^^^^^^^^^^
rustc>    |
rustc>    = note: `-D missing-docs` implied by `-D warnings`
rustc>    = help: to override `-D warnings` add `#[allow(missing_docs)]`
rustc>
rustc>     Checking compiler_builtins v0.1.160 (/nix/var/nix/builds/nix-78118-1377149852/rustc-1.92.0-src/library/compiler-builtins/compiler-builtins)
rustc> error: could not document `core`
rustc> warning: build failed, waiting for other jobs to finish...
rustc> Command `/nix/store/h499wcc6pl9whxa2kznjm76wy4f3lcm0-cargo-bootstrap-1.92.0/bin/cargo doc --target wasm32-unknown-unknown -Zbinary-dep-depinfo -j 10 -Zroot-dir=/nix/var/nix/builds/nix-78118-1377149852/rustc-1.92.0-src --frozen --release -p alloc -p compiler_builtins -p core -p panic_abort -p panic_unwind -p proc_macro -p rustc-std-workspace-core -p std -p std_detect -p sysroot -p test -p unwind --features 'backtrace panic-unwind' --manifest-path /nix/var/nix/builds/nix-78118-1377149852/rustc-1.92.0-src/library/sysroot/Cargo.toml --no-deps --target-dir /nix/var/nix/builds/nix-78118-1377149852/rustc-1.92.0-src/build/aarch64-apple-darwin/stage1-std/wasm32-unknown-unknown/doc -Zskip-rustdoc-fingerprint -Zrustdoc-map [workdir=/nix/var/nix/builds/nix-78118-1377149852/rustc-1.92.0-src]` failed with exit code 101
rustc> Created at: src/bootstrap/src/core/build_steps/doc.rs:781:21
rustc> Executed at: src/bootstrap/src/core/build_steps/doc.rs:814:22
rustc>
rustc> Command has failed. Rerun with -v to see more details.
```
2026-01-27 12:50:54 +11:00
Stuart Cook
4e4b5bf6f5
Rollup merge of #151699 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/reference

5 commits in 28b5a54419985f03db5294de5eede71b6665b594..990819b86c22bbf538c0526f0287670f3dc1a67a
2026-01-20 20:46:59 UTC to 2026-01-14 01:48:22 UTC

- Rename the ".general" rules (rust-lang/reference#2133)
- Unwrap more chapters (rust-lang/reference#2134)
- Add missing semicolon to ambiguity.glob-vs-glob (rust-lang/reference#2132)
- Fix spacing with ordered lists (rust-lang/reference#2131)
- Reflect explicit macro import in reference (rust-lang/reference#2077)

## rust-lang/rust-by-example

6 commits in 8de6ff811315ac3a96ebe01d74057382e42ffdee..bac931ef1673af63fb60c3d691633034713cca20
2026-01-25 21:02:15 UTC to 2026-01-14 19:45:27 UTC

- Update supertraits.md (rust-lang/rust-by-example#1988)
- Update question_mark.md (rust-lang/rust-by-example#1990)
- Update deprecated functions in `Box::leak` example (rust-lang/rust-by-example#1992)
- Improve Clone and Copy traits documentation (rust-lang/rust-by-example#1993)
- Fix typo (rust-lang/rust-by-example#1986)
- Korean translation! (rust-lang/rust-by-example#1985)
2026-01-27 12:50:54 +11:00
Stuart Cook
6b6584fdc0
Rollup merge of #151689 - zzaekkii:xtensa-installation, r=jieyouxu
Fix broken Xtensa installation link

### Location (URL)
https://doc.rust-lang.org/rustc/platform-support/xtensa.html

<img width="800" alt="image" src="https://github.com/user-attachments/assets/dbf1fea5-e65f-4bb2-beea-bf3267b12aff" />

### Summary
The Xtensa platform documentation currently links to an outdated Rust on ESP Book installation page that no longer exists.

The Rust on ESP Book has been reorganized, and the installation instructions previously referenced under `/book/installation/` are now located under the Getting Started section.

The link is updated to reference the current Toolchain Installation page, which contains the up-to-date instructions for building Xtensa targets.
2026-01-27 12:50:53 +11:00
Stuart Cook
bf01ad8916
Rollup merge of #151669 - quaternic:rename-gather-scatter-bits, r=scottmcm
rename uN::{gather,scatter}_bits to uN::{extract,deposit}_bits

Feature gate: `#![feature(uint_gather_scatter_bits)]`
Tracking issue: https://github.com/rust-lang/rust/issues/149069

Rename the methods as requested in https://github.com/rust-lang/rust/issues/149069#issuecomment-3633691777
 -  `gather_bits` -> `extract_bits`
 -  `scatter_bits` -> `deposit_bits`
2026-01-27 12:50:53 +11:00
Stuart Cook
af523529be
Rollup merge of #151529 - tgross35:lint-apfloat, r=nnethercote
lint: Use rustc_apfloat for `overflowing_literals`, add f16 and f128

Switch to parsing float literals for overflow checks using `rustc_apfloat` rather than host floats. This avoids small variations in platform support and makes it possible to start checking `f16` and `f128` as well.

Using APFloat matches what we try to do elsewhere to avoid platform inconsistencies.
2026-01-27 12:50:52 +11:00
Stuart Cook
956ebbde20
Rollup merge of #151383 - cyrgani:no-internal-deprecation, r=scottmcm
remove `#[deprecated]` from unstable & internal `SipHasher13` and `24` types

These types are unstable and `doc(hidden)` (under the internal feature `hashmap_internals`). Deprecating them only adds noise (`#[allow(deprecated)]`) to all places where they are used, so this PR removes the deprecation attributes from them.

It also includes a few other small cleanups in separate commits, including one I overlooked in rust-lang/rust#151228.
2026-01-27 12:50:52 +11:00
Stuart Cook
957801bf74
Rollup merge of #151040 - moulins:public-variant-layout, r=makai410
Don't expose redundant information in `rustc_public`'s `LayoutShape`

Enum variant layouts don't need to store a full `LayoutShape`; just storing the fields offsets is enough and all other information can be inferred from the parent layout:
- size, align and ABI don't make much sense for individual variants and should generally be taken from the parent layout instead;
- variants always have `fields: FieldsShape::Arbitrary { .. }` and `variant: VariantShape::Single { .. }`.

In principle, the same refactor could be done on `rustc_abi::Layout` (see [this comment](https://github.com/rust-lang/rust/issues/113988#issuecomment-1646982272)) but I prefer starting with this smaller change first.
2026-01-27 12:50:52 +11:00
Stuart Cook
db654cb421
Rollup merge of #150863 - ferrocene:add-aarch64v8r-targets, r=wesleywiser
Adds two new Tier 3 targets - `aarch64v8r-unknown-none{,-softfloat}`

## New Tier 3 targets - `aarch64v8r-unknown-none` and `aarch64v8r-unknown-none-softfloat`

This PR adds two new Tier 3 targets - `aarch64v8r-unknown-none` and `aarch64v8r-unknown-none-softfloat`.

The existing `aarch64-unknown-none` target assumes Armv8.0-A as a baseline. However, Arm recently released the Arm Cortex-R82 processor which is the first to implement the Armv8-R AArch64 mode architecture. This architecture is similar to Armv8-A AArch64, however it has a different set of mandatory features, and is based off of Armv8.4. It is largely unrelated to the existing Armv8-R architecture target (`armv8r-none-eabihf`), which only operates in AArch32 mode.

The second `aarch64v8r-unknown-none-softfloat` target allows for possible Armv8-R AArch64 CPUs with no FPU, or for use-cases where FPU register stacking is not desired. As with the existing `aarch64-unknown-none` target we have coupled FPU support and Neon support together - there is no 'has FPU but does not have NEON' target proposed even though the architecture technically allows for it.

These targets are in support of firmware development on upcoming systems using the Arm Cortex-R82, particularly safety-critical firmware development. For now, it can be tested using the Arm's Armv8-R AArch64 Fixed Virtual Platform emulator, which we have used to test this target. We are also in the process of testing this target with the full compiler test suite as part of Ferrocene, in the same way we test `aarch64-unknown-none` to a safety-qualified standard. We have not identified any issues as yet, but if we do, we will send the fixes upstream to you.

## Ownership

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.

## Tier 3 Policy Notes

To cover off the Tier 3 requirements:

> A tier 3 target must have a designated developer or developers

Arm will maintain this target, and I have presumed the Embedded Devices Working Group will also take an interest, as they maintain the existing Arm bare-metal targets.

> Targets must use naming consistent with any existing targets

We prefix this target with `aarch64` because it generates A64 machine code (like `arm*` generates A32 and `thumb*` generates T32). In an ideal world I'd get to rename the existing target `aarch64v8a-unknown-none` but that's basically impossible at this point. You can assume `v6` for any `arm*` target where unspecified, and you can assume `v8a` for any `aarch64*` target where not specified.

> 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.

It works just like the existing AArch64 bare-metal 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.

It's a bare-metal target, offering libcore and liballoc.

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

Done

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target.

AArch64 is a Tier 1 architecture, so I don't expect this target to cause any issues.

> 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.

It's AArch64 and so works with LLVM.
2026-01-27 12:50:51 +11:00
Stuart Cook
92e8bf864b
Rollup merge of #151680 - ChrisDenton:bindgen, r=tgross35
Update backtrace and windows-bindgen

Supersedes the backtrace bump in rust-lang/rust#151659

This is mostly just renaming `windows_targets` to `windows_link` but it needs to be done in tandem with the backtrace submodule update. The reason for doing this is that backtrace is both copy/pasted into std (via being a submodule) and published as an independent crate.
2026-01-27 12:50:51 +11:00
Stuart Cook
933e686e91
Rollup merge of #151137 - osiewicz:151090-checksum-freshness-binary-files, r=jdonszelmann
checksum-freshness: Fix invalid checksum calculation for binary files

Admittedly this is not the cleanest way to achieve this, but SourceMap is quite intertwined with source files being represented as Strings.
Tracking issue: https://github.com/rust-lang/cargo/issues/14136
Closes: rust-lang/rust#151090
2026-01-27 12:50:50 +11:00
Stuart Cook
b4f8dc726f
Rollup merge of #148718 - estebank:macro-spans, r=nnethercote
Do not mention `-Zmacro-backtrace` for std macros that are a wrapper around a compiler intrinsic
2026-01-27 12:50:50 +11:00
Stuart Cook
586f7aa02b
Rollup merge of #147996 - pmur:murp/stabilize-ppc-inlineasm, r=Amanieu
Stabilize ppc inline assembly

This stabilizes inline assembly for PowerPC and PowerPC64.

Corresponding reference PR: rust-lang/reference#2056

---

From the requirements of stabilization mentioned in https://github.com/rust-lang/rust/issues/93335

> Each architecture needs to be reviewed before stabilization:

> * It must have clobber_abi.

Done in https://github.com/rust-lang/rust/pull/146949.

> * It must be possible to clobber every register that is normally clobbered by a function call.

Done in https://github.com/rust-lang/rust/pull/131341

Similarly, `preserves_flags` is also implemented by this PR. Likewise, there is a non-code change to `preserve_flags` expectations that floating point and vector status and sticky bits are preserved. The reference manual update has more details.

 > * Generally review that the exposed register classes make sense.

The followings can be used as input/output:
* reg (`r0`, `r[3-12]`, `r[14-r28]`): Any usable general-purpose register
* reg_nonzero (`r[3-12]`, `r[14-r28]`): General-purpose registers, but excludes `r0`. This is needed for instructions which define `r0` to be the value 0, such as register + immediate memory operations.
* reg/reg_nonzero `r29` on PowerPC64 targets.
* freg (`f[0-31]`): 64 bit floating pointer registers

The following are clobber-only:

* `ctr`, `lr`, `xer`: commonly clobbered special-purpose registers used in inline asm
* `cr` (`cr[0-7]`, `cr`): the condition register fields, or the entire condition register.
* `vreg` (`v[0-31]`): altivec/vmx register
* `vsreg` (`vs[0-63]`): vector-scalar register
* `spe_acc`: SPE accumulator, only available for PowerPC SPE targets.

The vreg and vsreg registers technically accept `#[repr(simd)]` types, but require the experimental `altivec` or `vsx` target features to be enabled. That work seems to be tracked here, rust-lang/rust#42743.

The following cannot be used as operands for inline asm:

* `r2`: the TOC pointer, required for most PIC code.
* `r13`: the TLS pointer
* `r[29]`: Reserved for internal usage by LLVM on PowerPC
* `r[30]`: Reserved for internal usage by LLVM on PowerPC and PowerPC64
* `r31`: the frame pointer
* `vrsave`: this is effectively an unused special-purpose register.

The `preserves_flags` behavior is updated with the following behavior (Note, this is not enforceable today due to LLVM restrictions):
* All status and sticky bits of `fpscr`, `spefscr`, and `vscr` are preserved.

The following registers are unavailable:
* `mma[0-7]`: These are new "registers" available on Power10, they are 512b registers which overlay 4x vsx registers. If needed, users can mark such clobbers as vsN*4, vsN*4+1,...,vsN*4+3.
* `ap`: This is actually a pseudo-register in gcc/llvm.
* `mq`: This register is only available on Power1 and Power2, and is not supported by llvm.

---
cc @taiki-e
r? @Amanieu
@rustbot label +A-inline-assembly
2026-01-27 12:50:49 +11:00
Trevor Gross
9b15010686 lint: Use rustc_apfloat for overflowing_literals, add f16 and f128
Switch to parsing float literals for overflow checks using
`rustc_apfloat` rather than host floats. This avoids small variations in
platform support and makes it possible to start checking `f16` and
`f128` as well.

Using APFloat matches what we try to do elsewhere to avoid platform
inconsistencies.
2026-01-26 18:25:42 -06:00
bors
b3cda168c8 Auto merge of #151701 - JonathanBrouwer:rollup-PvhvBqX, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#151290 (Recover from struct literals with placeholder or empty path)
 - rust-lang/rust#148187 (Remove uses of `&mut CmResolver`)
 - rust-lang/rust#151368 (Rustdoc performance improvements)
 - rust-lang/rust#151374 (some more rustc_borrowck cleanups)
 - rust-lang/rust#151536 (Fix sanitizer target builds on CI)
 - rust-lang/rust#151626 (Remove `Deref<Target = TyCtxt>` from `QueryCtxt`)
 - rust-lang/rust#151661 (Suggest changing `iter`/`into_iter` when the other was meant)
2026-01-26 20:33:36 +00:00
Esteban Küber
4a27be6972 Do not mention -Zmacro-backtrace for std macros that are a wrapper around a compiler intrinsic 2026-01-26 17:34:31 +00:00
Jonathan Brouwer
9ad4ae88cf
Rollup merge of #151661 - estebank:issue-68095, r=mati865
Suggest changing `iter`/`into_iter` when the other was meant

When encountering a call to `iter` that should have been `into_iter` and vice-versa, provide a structured suggestion:

```
error[E0271]: type mismatch resolving `<IntoIter<{integer}, 3> as IntoIterator>::Item == &{integer}`
  --> $DIR/into_iter-when-iter-was-intended.rs:5:37
   |
LL |     let _a = [0, 1, 2].iter().chain([3, 4, 5].into_iter());
   |                               ----- ^^^^^^^^^^^^^^^^^^^^^ expected `&{integer}`, found integer
   |                               |
   |                               required by a bound introduced by this call
   |
note: the method call chain might not have had the expected associated types
  --> $DIR/into_iter-when-iter-was-intended.rs:5:47
   |
LL |     let _a = [0, 1, 2].iter().chain([3, 4, 5].into_iter());
   |                                     --------- ^^^^^^^^^^^ `IntoIterator::Item` is `{integer}` here
   |                                     |
   |                                     this expression has type `[{integer}; 3]`
note: required by a bound in `std::iter::Iterator::chain`
  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
help: consider not consuming the `[{integer}, 3]` to construct the `Iterator`
   |
LL -     let _a = [0, 1, 2].iter().chain([3, 4, 5].into_iter());
LL +     let _a = [0, 1, 2].iter().chain([3, 4, 5].iter());
   |
```

Finish addressing the original case in rust-lang/rust#68095. Only the case of chaining a `Vec` or `[]` is left unhandled.
2026-01-26 18:19:17 +01:00
Jonathan Brouwer
e1760d43cf
Rollup merge of #151626 - Zalathar:qcx-deref, r=tiif
Remove `Deref<Target = TyCtxt>` from `QueryCtxt`

Explicitly writing `self.tcx` is easy enough, and lets us remove a bit of non-essential deref magic.
2026-01-26 18:19:16 +01:00
Jonathan Brouwer
a975a74a7a
Rollup merge of #151536 - jakos-sec:fix-asan-target, r=Kobzol
Fix sanitizer target builds on CI
2026-01-26 18:19:15 +01:00
Jonathan Brouwer
e875916a05
Rollup merge of #151374 - BoxyUwU:borrowck_cleanup_3, r=lcnr
some more rustc_borrowck cleanups

r? lcnr
2026-01-26 18:19:14 +01:00
Jonathan Brouwer
621c712108
Rollup merge of #151368 - GuillaumeGomez:librustdoc-perf, r=yotamofek
Rustdoc performance improvements

A few things I had sitting around for a while. Let's check what perf says about them

r? @yotamofek
2026-01-26 18:19:14 +01:00
Jonathan Brouwer
bd85bab5a5
Rollup merge of #148187 - LorrensP-2158466:cm-res-variance, r=petrochenkov
Remove uses of `&mut CmResolver`

Before rust-lang/rust#148329, using CmResolver in closures was not possible when trying to reborrow. This pr changes uses of `&mut CmResolver` into a bare `CmResolver`, to keep the code clean (and to not have `&mut &mut Resolver`)

r? @petrochenkov
2026-01-26 18:19:13 +01:00
Jonathan Brouwer
6ff5bb3968
Rollup merge of #151290 - Unique-Usman:ua/nostruct, r=estebank
Recover from struct literals with placeholder or empty path

Based on earlier work by León Orell Valerian Liehr.
2026-01-26 18:19:12 +01:00
Luka Blašković
d541277ce1 os allow missing_docs 2026-01-26 17:08:00 +00:00
rustbot
1f6a55d8ba Update books 2026-01-26 18:00:52 +01:00
zakie
8d6b2f6a49 docs: fix broken Xtensa installation link 2026-01-26 23:36:26 +09:00
Guillaume Gomez
bd453118ee Improve code 2026-01-26 14:59:50 +01:00
Guillaume Gomez
dd42a9f118 Replace regex with find calls 2026-01-26 14:59:50 +01:00
Guillaume Gomez
3757ce6d1f Remove a string comparison and reduce number of clones in Hierarchy::add_path 2026-01-26 14:59:49 +01:00
bors
474276961f Auto merge of #151676 - adwinwhite:next-263, r=lcnr
Do not return incorrectly constrained opaques in `method_autoderef_steps`


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

r? @lcnr
2026-01-26 13:54:11 +00:00
Jonathan Pallant
6ecb3f33f0
Adds two new Tier 3 targets - aarch64v8r-unknown-none and aarch64v8r-unknown-none-softfloat.
The existing `aarch64-unknown-none` target assumes Armv8.0-A as a baseline. However, Arm recently released the Arm Cortex-R82 processor which is the first to implement the Armv8-R AArch64 mode architecture. This architecture is similar to Armv8-A AArch64, however it has a different set of mandatory features, and is based off of Armv8.4. It is largely unrelated to the existing Armv8-R architecture target (`armv8r-none-eabihf`), which only operates in AArch32 mode.

The second `aarch64v8r-unknown-none-softfloat` target allows for possible Armv8-R AArch64 CPUs with no FPU, or for use-cases where FPU register stacking is not desired. As with the existing `aarch64-unknown-none` target we have coupled FPU support and Neon support together - there is no 'has FPU but does not have NEON' target proposed even though the architecture technically allows for it.

This PR was developed by Ferrous Systems on behalf of Arm. Arm is the owner of these changes.
2026-01-26 12:43:52 +00:00
Piotr Osiewicz
0df94dd94e checksum-freshness: Fix incorrect hash/file length values of binary
dependency files
2026-01-26 12:09:55 +01:00
Chris Denton
aaeb550f6f
Update windows bindings in std 2026-01-26 10:59:16 +00:00
Chris Denton
8a32fcee2f
Update backtrace 2026-01-26 10:57:35 +00:00
Boxy
dab7c0923e Misc cleanups to borrowck crate 2026-01-26 10:24:15 +00:00
Adwin White
f6efe7e1d5 don't return incorrectly constrained opaques in method_autoderef_steps 2026-01-26 17:30:18 +08:00
bors
db6bc0f6a4 Auto merge of #151674 - Zalathar:rollup-pNhrXnP, r=Zalathar
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#151612 (Update documentation for `cold_path`, `likely`, and `unlikely`)
 - rust-lang/rust#151670 (compiletest: Parse aux `proc-macro` directive into struct)
2026-01-26 09:25:45 +00:00
Stuart Cook
43b955a4dd
Rollup merge of #151670 - Enselic:proc-macro-struct, r=Zalathar
compiletest: Parse aux `proc-macro` directive into struct

This PR does not introduce any changes. It is pure refactoring to make PR rust-lang/rust#151258 smaller so it is easier to see what that PR is about, as discussed [here](https://github.com/rust-lang/rust/pull/151258#issuecomment-3766358454).

r? @Zalathar
2026-01-26 19:52:42 +11:00
Stuart Cook
443c5b0742
Rollup merge of #151612 - tgross35:cold-path-doc, r=scottmcm
Update documentation for `cold_path`, `likely`, and `unlikely`

* Add a note recommending benchmarks to `cold_path`, as other hints have
* Note that `cold_path` can be used to implement `likely` and `unlikely`
* Update the tracking issue for the `likely_unlikely` feature

Tracking issue: https://github.com/rust-lang/rust/issues/136873
Tracking issue: https://github.com/rust-lang/rust/issues/151619
2026-01-26 19:52:41 +11:00
bors
0462e8f7e5 Auto merge of #151667 - Zalathar:rollup-OzG0S5m, r=Zalathar
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#151611 (Improve is_ascii performance on x86_64 with explicit SSE2 intrinsics)
 - rust-lang/rust#150705 (Add missing mut to pin.rs docs)
 - rust-lang/rust#151294 (compiletest: add implied `needs-target-std` for `codegen` mode tests unless annotated with `#![no_std]`/`#![no_core]`)
 - rust-lang/rust#151589 (Add a `documentation` remapping path scope for rustdoc usage)
 - rust-lang/rust#151639 (Fix broken WASIp1 reference link)
 - rust-lang/rust#151645 (Update `sysinfo` version to `0.38.0`)
2026-01-26 05:42:45 +00:00
Martin Nordholts
30e41dec0c compiletest: Parse aux proc-macro directive into struct
To minimize the diff when adding features the aux `proc-macro`
directive.
2026-01-26 06:39:33 +01:00
Juho Kahala
29596f87be rename uN::{gather,scatter}_bits to uN::{extract,deposit}_bits 2026-01-26 06:28:42 +02:00
Stuart Cook
ec48041b20
Rollup merge of #151645 - GuillaumeGomez:update-sysinfo, r=Kobzol
Update `sysinfo` version to `0.38.0`

Some bugfixes and added supported for NetBSD.

r? @Kobzol
2026-01-26 14:36:23 +11:00
Stuart Cook
237d17fc69
Rollup merge of #151639 - zzaekkii:wasm32-wasip1, r=madsmtm
Fix broken WASIp1 reference link

### Location (URL)
https://doc.rust-lang.org/rustc/platform-support/wasm32-wasip1.html

<img width="800" alt="image" src="https://github.com/user-attachments/assets/b9402b3a-db7b-405f-b4ef-d849c03ad893" />

### Summary
The WASIp1 reference link in the `wasm32-wasip1` platform documentation currently points to a path that no longer exists in the WASI repository.

The WASI project recently migrated the WASI 0.1 (preview1) documentation from the `legacy/preview1` directory to the dedicated `wasi-0.1` branch (WebAssembly/WASI#855).

This updates the link to point to the intended historical WASIp1 reference, which matches the documented intent of the `wasm32-wasip1` target.
2026-01-26 14:36:23 +11:00
Stuart Cook
e811f07736
Rollup merge of #151589 - Urgau:documentation-scope, r=GuillaumeGomez
Add a `documentation` remapping path scope for rustdoc usage

This PR adds a new remapping path scope for rustdoc usage: `documentation`, instead of rustdoc abusing the other scopes for it's usage.

Like remapping paths in rustdoc, this scope is unstable. (rustdoc doesn't even have yet an equivalent to [rustc `--remap-path-scope`](https://doc.rust-lang.org/nightly/rustc/remap-source-paths.html#--remap-path-scope)).

I also took the opportunity to add a bit of documentation in rustdoc book.
2026-01-26 14:36:22 +11:00
Stuart Cook
504c7fe65d
Rollup merge of #151294 - jieyouxu:infer-needs-target-std, r=Zalathar
compiletest: add implied `needs-target-std` for `codegen` mode tests unless annotated with `#![no_std]`/`#![no_core]`

A `codegen` mode test (such as `codegen-llvm` test suite) will now by default have an implied `//@ needs-target-std` directive, *unless* the test explicitly has an `#![no_std]`/`#![no_core]` attribute which disables this behavior.

- When a test has both `#![no_std]`/`#![no_core]` and `//@ needs-target-std`, the explicit `//@ needs-target-std` directive will cause the test to be ignored for targets that do not support std still.

This is to make it easier to test out-of-tree targets / custom targets (and targets not tested in r-l/r CI) without requiring target maintainers to do a bunch of manual `//@ needs-target-std` busywork.

Context: [#t-compiler/help > &#96;compiletest&#96; cannot find &#96;core&#96; library for target != host](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60compiletest.60.20cannot.20find.20.60core.60.20library.20for.20target.20!.3D.20host/with/568652419)

## Implementation remarks

This is an alternative version of https://github.com/rust-lang/rust/pull/150672, with some differences:

- *This* PR applies this implied-`needs-target-std` behavior to all `codegen` test mode tests.
- *This* PR does the synthetic directive injection in the same place as implied-`codegen-run` directives. Both are of course hacks, but at least they're together next to each other.
2026-01-26 14:36:22 +11:00
Stuart Cook
ef849a2c7d
Rollup merge of #150705 - justanotheranonymoususer:patch-1, r=joboet
Add missing mut to pin.rs docs

Per my understanding, needed for mut access next line.
2026-01-26 14:36:21 +11:00
Stuart Cook
a6e8a31b86
Rollup merge of #151611 - bonega:improve-is-slice-is-ascii-performance, r=folkertdev
Improve is_ascii performance on x86_64 with explicit SSE2 intrinsics

# Summary

Improves `slice::is_ascii` performance for SSE2 target roughly 1.5-2x on larger inputs.
AVX-512 keeps similiar performance characteristics.

This is building on the work already merged in rust-lang/rust#151259.
In particular this PR improves the default SSE2 performance, I don't consider this a temporary fix anymore.
Thanks to @folkertdev for pointing me to consider `as_chunk` again.

# The implementation:
- Uses 64-byte chunks with 4x 16-byte SSE2 loads OR'd together
- Extracts the MSB mask with a single `pmovmskb` instruction
- Falls back to usize-at-a-time SWAR for inputs < 64 bytes

# Performance impact (vs before rust-lang/rust#151259):
- AVX-512: 34-48x faster
- SSE2: 1.5-2x faster

  <details>
  <summary>Benchmark Results (click to expand)</summary>

  Benchmarked on AMD Ryzen 9 9950X (AVX-512 capable). Values show relative performance (1.00 = fastest).
  Tops out at 139GB/s for large inputs.

  ### early_non_ascii

  | Input Size | new_avx512 | new_sse2 | old_avx512 | old_sse2 |
  |------------|------------|----------|------------|----------|
  | 64 | 1.01 | **1.00** | 13.45 | 1.13 |
  | 1024 | 1.01 | **1.00** | 13.53 | 1.14 |
  | 65536 | 1.01 | **1.00** | 13.99 | 1.12 |
  | 1048576 | 1.02 | **1.00** | 13.29 | 1.12 |

  ### late_non_ascii

  | Input Size | new_avx512 | new_sse2 | old_avx512 | old_sse2 |
  |------------|------------|----------|------------|----------|
  | 64 | **1.00** | 1.01 | 13.37 | 1.13 |
  | 1024 | 1.10 | **1.00** | 42.42 | 1.95 |
  | 65536 | **1.00** | 1.06 | 42.22 | 1.73 |
  | 1048576 | **1.00** | 1.03 | 34.73 | 1.46 |

  ### pure_ascii

  | Input Size | new_avx512 | new_sse2 | old_avx512 | old_sse2 |
  |------------|------------|----------|------------|----------|
  | 4 | 1.03 | **1.00** | 1.75 | 1.32 |
  | 8 | **1.00** | 1.14 | 3.89 | 2.06 |
  | 16 | **1.00** | 1.04 | 1.13 | 1.62 |
  | 32 | 1.07 | 1.19 | 5.11 | **1.00** |
  | 64 | **1.00** | 1.13 | 13.32 | 1.57 |
  | 128 | **1.00** | 1.01 | 19.97 | 1.55 |
  | 256 | **1.00** | 1.02 | 27.77 | 1.61 |
  | 1024 | **1.00** | 1.02 | 41.34 | 1.84 |
  | 4096 | 1.02 | **1.00** | 45.61 | 1.98 |
  | 16384 | 1.01 | **1.00** | 48.67 | 2.04 |
  | 65536 | **1.00** | 1.03 | 43.86 | 1.77 |
  | 262144 | **1.00** | 1.06 | 41.44 | 1.79 |
  | 1048576 | 1.02 | **1.00** | 35.36 | 1.44 |

  </details>

## 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

Relates to: https://github.com/llvm/llvm-project/issues/176906
2026-01-26 14:36:21 +11:00
Trevor Gross
6c0ae93222 hint: Update the tracking issue for likely_unlikely
These were split from the `cold_path` tracking issue.
2026-01-25 20:34:12 -06:00