Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
672828e
Add missing mut to pin.rs docs
justanotheranonymoususer Jan 5, 2026
ee6dd56
Add test for invalid `--remap-path-scope` arguments
Urgau Jan 22, 2026
91e3e2a
Add the remapping path `documentation` scope for rustdoc usage
Urgau Jan 22, 2026
fbab2c0
Make rustdoc use the documentation remapping scope and cleanups
Urgau Jan 22, 2026
3d6a5b5
Make sure the `documentation` scope doesn't imply other scopes
Urgau Jan 24, 2026
dd84a4f
Add documentation for `--remap-path-prefix` and `doc` scope in rustdoc
Urgau Jan 24, 2026
a72f68e
Fix is_ascii performance on x86_64 with explicit SSE2 intrinsics
bonega Jan 24, 2026
9e80b1b
Fix broken WASIp1 reference link
zzaekkii Jan 25, 2026
cbcd869
Remove x86_64 assembly test for is_ascii
bonega Jan 25, 2026
36fb9f0
Update `sysinfo` version to `0.38.0`
GuillaumeGomez Jan 25, 2026
dbc870a
Mark is_ascii_sse2 as #[inline]
bonega Jan 25, 2026
841d781
compiletest: implied `needs-target-std` directive for `codegen` mode …
jieyouxu Jan 18, 2026
a6e8a31
Rollup merge of #151611 - bonega:improve-is-slice-is-ascii-performanc…
Zalathar Jan 26, 2026
ef849a2
Rollup merge of #150705 - justanotheranonymoususer:patch-1, r=joboet
Zalathar Jan 26, 2026
504c7fe
Rollup merge of #151294 - jieyouxu:infer-needs-target-std, r=Zalathar
Zalathar Jan 26, 2026
e811f07
Rollup merge of #151589 - Urgau:documentation-scope, r=GuillaumeGomez
Zalathar Jan 26, 2026
237d17f
Rollup merge of #151639 - zzaekkii:wasm32-wasip1, r=madsmtm
Zalathar Jan 26, 2026
ec48041
Rollup merge of #151645 - GuillaumeGomez:update-sysinfo, r=Kobzol
Zalathar Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 66 additions & 15 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ dependencies = [
"tracing-subscriber",
"unified-diff",
"walkdir",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -2038,7 +2038,7 @@ dependencies = [
"serde",
"tempfile",
"uuid",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -3698,7 +3698,7 @@ dependencies = [
"thorin-dwp",
"tracing",
"wasm-encoder 0.219.2",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -3756,7 +3756,7 @@ dependencies = [
"tempfile",
"thin-vec",
"tracing",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -3822,7 +3822,7 @@ dependencies = [
"serde_json",
"shlex",
"tracing",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -3873,7 +3873,7 @@ dependencies = [
"serde_json",
"termize",
"tracing",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -4664,7 +4664,7 @@ dependencies = [
"rustc_target",
"termize",
"tracing",
"windows",
"windows 0.61.3",
]

[[package]]
Expand Down Expand Up @@ -5438,14 +5438,14 @@ dependencies = [

[[package]]
name = "sysinfo"
version = "0.37.2"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16607d5caffd1c07ce073528f9ed972d88db15dd44023fa57142963be3feb11f"
checksum = "fe840c5b1afe259a5657392a4dbb74473a14c8db999c3ec2f4ae812e028a94da"
dependencies = [
"libc",
"objc2-core-foundation",
"objc2-io-kit",
"windows",
"windows 0.62.2",
]

[[package]]
Expand Down Expand Up @@ -6398,11 +6398,23 @@ version = "0.61.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
dependencies = [
"windows-collections",
"windows-collections 0.2.0",
"windows-core 0.61.2",
"windows-future",
"windows-future 0.2.1",
"windows-link 0.1.3",
"windows-numerics",
"windows-numerics 0.2.0",
]

[[package]]
name = "windows"
version = "0.62.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
dependencies = [
"windows-collections 0.3.2",
"windows-core 0.62.2",
"windows-future 0.3.2",
"windows-numerics 0.3.1",
]

[[package]]
Expand All @@ -6413,7 +6425,7 @@ checksum = "9b4e97b01190d32f268a2dfbd3f006f77840633746707fbe40bcee588108a231"
dependencies = [
"serde",
"serde_json",
"windows-threading",
"windows-threading 0.1.0",
]

[[package]]
Expand All @@ -6425,6 +6437,15 @@ dependencies = [
"windows-core 0.61.2",
]

[[package]]
name = "windows-collections"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
dependencies = [
"windows-core 0.62.2",
]

[[package]]
name = "windows-core"
version = "0.61.2"
Expand Down Expand Up @@ -6459,7 +6480,18 @@ checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
dependencies = [
"windows-core 0.61.2",
"windows-link 0.1.3",
"windows-threading",
"windows-threading 0.1.0",
]

[[package]]
name = "windows-future"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
dependencies = [
"windows-core 0.62.2",
"windows-link 0.2.1",
"windows-threading 0.2.1",
]

[[package]]
Expand Down Expand Up @@ -6506,6 +6538,16 @@ dependencies = [
"windows-link 0.1.3",
]

[[package]]
name = "windows-numerics"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
dependencies = [
"windows-core 0.62.2",
"windows-link 0.2.1",
]

[[package]]
name = "windows-result"
version = "0.3.4"
Expand Down Expand Up @@ -6611,6 +6653,15 @@ dependencies = [
"windows-link 0.1.3",
]

[[package]]
name = "windows-threading"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
dependencies = [
"windows-link 0.2.1",
]

[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
Expand Down
12 changes: 10 additions & 2 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,18 +1322,26 @@ impl OutputFilenames {
pub(crate) fn parse_remap_path_scope(
early_dcx: &EarlyDiagCtxt,
matches: &getopts::Matches,
unstable_opts: &UnstableOptions,
) -> RemapPathScopeComponents {
if let Some(v) = matches.opt_str("remap-path-scope") {
let mut slot = RemapPathScopeComponents::empty();
for s in v.split(',') {
slot |= match s {
"macro" => RemapPathScopeComponents::MACRO,
"diagnostics" => RemapPathScopeComponents::DIAGNOSTICS,
"documentation" => {
if !unstable_opts.unstable_options {
early_dcx.early_fatal("remapping `documentation` path scope requested but `-Zunstable-options` not specified");
}

RemapPathScopeComponents::DOCUMENTATION
},
"debuginfo" => RemapPathScopeComponents::DEBUGINFO,
"coverage" => RemapPathScopeComponents::COVERAGE,
"object" => RemapPathScopeComponents::OBJECT,
"all" => RemapPathScopeComponents::all(),
_ => early_dcx.early_fatal("argument for `--remap-path-scope` must be a comma separated list of scopes: `macro`, `diagnostics`, `debuginfo`, `coverage`, `object`, `all`"),
_ => early_dcx.early_fatal("argument for `--remap-path-scope` must be a comma separated list of scopes: `macro`, `diagnostics`, `documentation`, `debuginfo`, `coverage`, `object`, `all`"),
}
}
slot
Expand Down Expand Up @@ -2677,7 +2685,7 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
let externs = parse_externs(early_dcx, matches, &unstable_opts);

let remap_path_prefix = parse_remap_path_prefix(early_dcx, matches, &unstable_opts);
let remap_path_scope = parse_remap_path_scope(early_dcx, matches);
let remap_path_scope = parse_remap_path_scope(early_dcx, matches, &unstable_opts);

let pretty = parse_pretty(early_dcx, &unstable_opts);

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ bitflags::bitflags! {
const DEBUGINFO = 1 << 3;
/// Apply remappings to coverage information
const COVERAGE = 1 << 4;
/// Apply remappings to documentation information
const DOCUMENTATION = 1 << 5;

/// An alias for `macro`, `debuginfo` and `coverage`. This ensures all paths in compiled
/// executables, libraries and objects are remapped but not elsewhere.
Expand Down
6 changes: 2 additions & 4 deletions library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,15 +831,13 @@
//! <code>fn get_pin_mut(self: [Pin]<[`&mut Self`]>) -> [Pin]<[`&mut T`]></code>.
//! Then we could do the following:
//! ```compile_fail
//! # use std::cell::RefCell;
//! # use std::pin::Pin;
//! fn exploit_ref_cell<T>(rc: Pin<&mut RefCell<T>>) {
//! fn exploit_ref_cell<T>(mut rc: Pin<&mut RefCell<T>>) {
//! // Here we get pinned access to the `T`.
//! let _: Pin<&mut T> = rc.as_mut().get_pin_mut();
//!
//! // And here we have `&mut T` to the same data.
//! let shared: &RefCell<T> = rc.into_ref().get_ref();
//! let borrow = shared.borrow_mut();
//! let mut borrow = shared.borrow_mut();
//! let content = &mut *borrow;
//! }
//! ```
Expand Down
62 changes: 22 additions & 40 deletions library/core/src/slice/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,56 +460,38 @@ const fn is_ascii(s: &[u8]) -> bool {
)
}

/// Chunk size for vectorized ASCII checking (two 16-byte SSE registers).
/// Chunk size for SSE2 vectorized ASCII checking (4x 16-byte loads).
#[cfg(all(target_arch = "x86_64", target_feature = "sse2"))]
const CHUNK_SIZE: usize = 32;
const SSE2_CHUNK_SIZE: usize = 64;

/// SSE2 implementation using `_mm_movemask_epi8` (compiles to `pmovmskb`) to
/// avoid LLVM's broken AVX-512 auto-vectorization of counting loops.
///
/// FIXME(llvm#176906): Remove this workaround once LLVM generates efficient code.
#[cfg(all(target_arch = "x86_64", target_feature = "sse2"))]
#[inline]
fn is_ascii_sse2(bytes: &[u8]) -> bool {
use crate::arch::x86_64::{__m128i, _mm_loadu_si128, _mm_movemask_epi8, _mm_or_si128};

let mut i = 0;

while i + CHUNK_SIZE <= bytes.len() {
// SAFETY: We have verified that `i + CHUNK_SIZE <= bytes.len()`.
let ptr = unsafe { bytes.as_ptr().add(i) };

// Load two 16-byte chunks and combine them.
// SAFETY: We verified `i + 32 <= len`, so ptr is valid for 32 bytes.
// `_mm_loadu_si128` allows unaligned loads.
let chunk1 = unsafe { _mm_loadu_si128(ptr as *const __m128i) };
// SAFETY: Same as above - ptr.add(16) is within the valid 32-byte range.
let chunk2 = unsafe { _mm_loadu_si128(ptr.add(16) as *const __m128i) };

// OR them together - if any byte has the high bit set, the result will too.
// SAFETY: SSE2 is guaranteed by the cfg predicate.
let combined = unsafe { _mm_or_si128(chunk1, chunk2) };

// Create a mask from the MSBs of each byte.
// If any byte is >= 128, its MSB is 1, so the mask will be non-zero.
// SAFETY: SSE2 is guaranteed by the cfg predicate.
let mask = unsafe { _mm_movemask_epi8(combined) };

let (chunks, rest) = bytes.as_chunks::<SSE2_CHUNK_SIZE>();

for chunk in chunks {
let ptr = chunk.as_ptr();
// SAFETY: chunk is 64 bytes. SSE2 is baseline on x86_64.
let mask = unsafe {
let a1 = _mm_loadu_si128(ptr as *const __m128i);
let a2 = _mm_loadu_si128(ptr.add(16) as *const __m128i);
let b1 = _mm_loadu_si128(ptr.add(32) as *const __m128i);
let b2 = _mm_loadu_si128(ptr.add(48) as *const __m128i);
// OR all chunks - if any byte has high bit set, combined will too.
let combined = _mm_or_si128(_mm_or_si128(a1, a2), _mm_or_si128(b1, b2));
// Create a mask from the MSBs of each byte.
// If any byte is >= 128, its MSB is 1, so the mask will be non-zero.
_mm_movemask_epi8(combined)
};
if mask != 0 {
return false;
}

i += CHUNK_SIZE;
}

// Handle remaining bytes with simple loop
while i < bytes.len() {
if !bytes[i].is_ascii() {
return false;
}
i += 1;
}

true
// Handle remaining bytes
rest.iter().all(|b| b.is_ascii())
}

/// ASCII test optimized to use the `pmovmskb` instruction on `x86-64`.
Expand All @@ -529,7 +511,7 @@ const fn is_ascii(bytes: &[u8]) -> bool {
is_ascii_simple(bytes)
} else {
// For small inputs, use usize-at-a-time processing to avoid SSE2 call overhead.
if bytes.len() < CHUNK_SIZE {
if bytes.len() < SSE2_CHUNK_SIZE {
let chunks = bytes.chunks_exact(USIZE_SIZE);
let remainder = chunks.remainder();
for chunk in chunks {
Expand Down
Loading
Loading