Rollup of 5 pull requests - #161022
Conversation
…ghtly` release channel
Tests can use the following comment configuration to mark themselves as only
running on `stable` / `beta` release channels.
```rust
// rustfmt-stable: true
```
> [!NOTE]
> Using `stable` here since we already have an `ustable` variant for nightly
> only tests and I didn't want to refactor things now, but in the future I think
> we should refactor this to be more like:
```rust
// rustfmt-cfg_release_channel: {stable|beta|nightly}
```
These tests show that `cfg_select!` won't be formatted on `stable` or `beta` release channels.
'hw.optional.AdvSIMD' sysctl key doesn't resolve on macOS 26.5.1 and 26.6, breaking `asimd` and `sha2`/`sha3` downstream. Now `asimd` is determined by checking 'hw.optional.AdvSIMD' || 'hw.optional.arm.AdvSIMD' to support old and new envs.
`rhs` is confusing since for the `Shl` and `Shr` traits, that is the name used for the value to shift by (i.e. `self >> rhs`).
It's a bit easier to understand the results of shifts and otherwise bitwise operations when leading zeros are present.
Shorten the summary line, cover shifts by zeros, rotates, and panics in examples, and turn the "Panics" section into a complete sentence.
…matting, r=jieyouxu rustfmt: restrict `cfg_select!` formatting to the `nightly` release channel Closes: rust-lang#160944 `cfg_select!` formatting was implemented in rust-lang#154202. The formatting diverged from what was outlined in the original Style FCP (rust-lang/style-team#201 (comment) and rust-lang#144323 (comment)). Since the 1.99 beta is scheduled to branch from main on August 14 I want to get this nightly formatting gate out so that we can correct the formatting issues before we promote the formatting to the beta / stable release channels. Style Guide PR: rust-lang#160967 r? @jieyouxu cc: @traviscross
…mulacrum core: Improve the documentation for funnel shifts Change the variable name to make things a bit more clear, then rework funnel shift documentation. Examples now cover shifting by zero and emulating rotates. Tracking issue: rust-lang#145686
…in-neon-detection, r=Amanieu Fix asimd/neon detection on aarch64-darwin Fixes rust-lang#160467 Previously `asimd` (alias for `neon`) for aarch64-darwin target was checked using 'hw.optional.AdvSIMD' key. As observed on macOS Tahoe 26.5.1 and 26.6: ```console $ sysctl -n hw.optional.AdvSIMD sysctl: unknown oid 'hw.optional.AdvSIMD' ``` Key has been replaced with: ```console $ sysctl -n hw.optional.arm.AdvSIMD 1 ``` On latest macOS versions, `asimd` check relying on older key without arm in its path is broken and breaks `sha2`/`sha3` downstream as they depend on `asimd` in [`library/std_detect/src/detect/os/darwin/aarch64.rs`](https://github.com/rust-lang/rust/blob/c98d0cb27cc63afdd62602a52eb4feb8a1c682dd/library/std_detect/src/detect/os/darwin/aarch64.rs#L154-L155): ```rust enable_feature(Feature::sha2, sha1 && sha256 && asimd); enable_feature(Feature::sha3, sha512 && sha3 && asimd); ``` Changed [from](https://github.com/rust-lang/rust/blob/c98d0cb27cc63afdd62602a52eb4feb8a1c682dd/library/std_detect/src/detect/os/darwin/aarch64.rs#L39): ```rust let asimd = _sysctlbyname(c"hw.optional.AdvSIMD"); ``` [To](https://github.com/patrikas-sestokas/rust/blob/eb3bf33322c2b8e94e865b2efb33c0e252e70a6b/library/std_detect/src/detect/os/darwin/aarch64.rs#L39): ```rust let asimd = _sysctlbyname(c"hw.optional.AdvSIMD") || _sysctlbyname(c"hw.optional.arm.AdvSIMD"); ``` To support both old and new environments. ## Verification `main.rs` using fixed version of std_detect: ```rust #![allow(internal_features)] #![feature(stdarch_internal)] use std_detect::is_aarch64_feature_detected; macro_rules! feature_bug_check { ($($f: tt),*) => { $( print!("{}:", $f); is_aarch64_feature_detected!($f).then(|| print!("r")); #[cfg(target_feature = $f)] print!("c"); println!(); )* }; } fn main() { feature_bug_check!( "neon", "sha2", "sha3", "crc", "fp16", "fcma", "dotprod", "rdm", "lse", "rcpc", "dit", "dpb", "dpb2", "jsconv", "paca", "pacg", "frintts", "flagm", "sb", "ssbs" ); } ``` `.cargo/config.toml` statically disabling `neon` to force runtime check: ```toml [target.'cfg(target_arch = "aarch64")'] rustflags = ["-C", "target-feature=-neon"] ``` `cargo run`: ```console neon:r sha2:r sha3:r crc:rc fp16:r fcma:r dotprod:r rdm:r lse:rc rcpc:rc dit:rc dpb:rc dpb2:rc jsconv:r paca:rc pacg:rc frintts:rc flagm:rc sb:rc ssbs:rc ``` Changing `std_detect::is_aarch64_feature_detected` to `std::arch::is_aarch64_feature_detected` reproduces rust-lang#160467: ```console neon: sha2: sha3: crc:rc fp16:r fcma:r dotprod:r rdm:r lse:rc rcpc:rc dit:rc dpb:rc dpb2:rc jsconv:r paca:rc pacg:rc frintts:rc flagm:rc sb:rc ssbs:rc ```
dogfood `#[diagnostic::unknown]` in the compiler
This makes the error for not-found symbols a lot nicer :)
```
error[E0425]: cannot find value `better_rust` in module `sym`
--> compiler\rustc_feature\src\unstable.rs:799:16
|
157 | name: sym::$feature,
| -------- due to this macro variable
...
799 | (unstable, better_rust, "2.0.0", Some(42)),
| ^^^^^^^^^^^ `better_rust` is not a pre-interned symbol
|
= note: consider adding `better_rust` to the `symbols!` invocation in compiler/rustc_span/src/symbol.rs
```
(only works when building stage 2 for now, the necessary changes haven't landed in beta yet)
Add regression test for const fn returning Vec of boxed dyn Any Closes rust-lang#84170
|
@bors r+ p=5 |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: 52d0866480 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 52d0866 (parent) -> 79ef636 (this PR) Test differencesShow 3438 test diffsStage 1
Stage 2
Additionally, 3435 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 79ef636a60b0f5ca061b09122bbbca3c7b4a3b70 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (79ef636): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 2.7%, secondary 3.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 459.695s -> 455.642s (-0.88%) |
Successful merges:
cfg_select!formatting to thenightlyrelease channel #160998 (rustfmt: restrictcfg_select!formatting to thenightlyrelease channel)#[diagnostic::unknown]in the compiler #160950 (dogfood#[diagnostic::unknown]in the compiler)r? @ghost
Create a similar rollup