Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4081c14
create_dir_all() operates iteratively instead of recursively
asder8215 Dec 14, 2025
167ad11
check if current path is root through seeing if its parent is None
asder8215 Dec 14, 2025
1ff953d
Fix and expand direct-access-external-data test
nbdd0121 Dec 29, 2025
5467a39
Fix dso_local for external statics with linkage
nbdd0121 Dec 29, 2025
2b76903
Use all thread::current static variables from realstd in tests.
Dec 18, 2025
abbbd77
Use re-exports from test_internals.
Dec 18, 2025
1cd8752
Unix implementation for stdio set/take/replace
the8472 Jan 4, 2026
a3359bd
Compile-Time Reflection MVP: tuples
oli-obk Mar 12, 2025
82028b0
Add size information
oli-obk Mar 14, 2025
665770e
Remove std_detect_file_io and std_detect_dlsym_getauxval features
bjorn3 Jan 8, 2026
3fed6e6
Remove a couple of outdated fields in std_detect Cargo.toml
bjorn3 Jan 8, 2026
c873d16
Remove unnecessary module
bjorn3 Jan 8, 2026
484ea76
adding minicore to test file to avoid duplicating lang error
paradoxicalguy Dec 31, 2025
0495a73
Prepare for `thir::Pat` nodes having multiple user-type ascriptions
Zalathar Jan 7, 2026
f85b898
Prefer to return `Box<thir::Pat>` instead of `thir::PatKind`
Zalathar Jan 6, 2026
bd77048
Initial plumbing for `thir::PatExtra`
Zalathar Jan 6, 2026
8516c64
Replace `AscribeUserType` and `ExpandedConstant` with per-node data
Zalathar Jan 6, 2026
7e433eb
[miri] make closing stdio file descriptions noops
the8472 Jan 9, 2026
fb296d7
Use f64 NaN in documentation instead of sqrt(-1.0)
tyilo Jan 9, 2026
87d7167
Reenable GCC CI download
Kobzol Jan 9, 2026
58a9fdd
Bump `download-ci-gcc-stamp`
Kobzol Jan 9, 2026
e0324b5
Emit an error for linking staticlibs on BPF
bjorn3 Jan 9, 2026
90c84d0
Reduce visibility of some errors
bjorn3 Jan 9, 2026
6426635
Fix unpacking of gcc-dev component
Kobzol Jan 9, 2026
f6f901f
std: sys: fs: uefi: Implement File::{flush, *sync}
Ayush1325 Jan 9, 2026
f982bc6
Fix ICE: can't type-check body of DefId, since type_consts don't have…
Keith-Cancel Jan 8, 2026
fc06a57
Introduce hir::ConstArgKind::Array
reddevilmidzy Jan 7, 2026
618b0b5
Lower hir::ConstArgKind::Array to a ValTree
reddevilmidzy Jan 8, 2026
522be7f
Fix clippy
reddevilmidzy Jan 8, 2026
f2f45ff
Add mGCA array expression tests
reddevilmidzy Jan 9, 2026
ccc86f2
std: sys: fs: uefi: Implement File::write
Ayush1325 Jan 9, 2026
26e666c
Rollup merge of #146923 - comptime-reflect, r=BoxyUwU
Zalathar Jan 10, 2026
9f800a3
Rollup merge of #148196 - std-fs-iterative-create-dir-all, r=Mark-Sim…
Zalathar Jan 10, 2026
3c12560
Rollup merge of #150131 - realstd_thread_variables, r=Mark-Simulacrum
Zalathar Jan 10, 2026
5b02485
Rollup merge of #150368 - minicore-ordering, r=workingjubilee
Zalathar Jan 10, 2026
6cceb00
Rollup merge of #150494 - extern_linkage_dso_local, r=bjorn3
Zalathar Jan 10, 2026
ea1e30f
Rollup merge of #150668 - stdio-swap, r=Mark-Simulacrum,RalfJung
Zalathar Jan 10, 2026
8b58a13
Rollup merge of #150786 - mgca-array, r=BoxyUwU
Zalathar Jan 10, 2026
989cdfe
Rollup merge of #150788 - thir-pat, r=Nadrieril
Zalathar Jan 10, 2026
d4afd4f
Rollup merge of #150799 - mcga, r=BoxyUwU
Zalathar Jan 10, 2026
0138235
Rollup merge of #150804 - std_detect_less_features, r=tgross35
Zalathar Jan 10, 2026
2ba1963
Rollup merge of #150852 - uefi-fs-write, r=joboet
Zalathar Jan 10, 2026
23e3528
Rollup merge of #150862 - uefi-fs-flush, r=the8472
Zalathar Jan 10, 2026
f233c1a
Rollup merge of #150871 - simplify-partialord-doc, r=jhpratt
Zalathar Jan 10, 2026
c91eb06
Rollup merge of #150873 - reenable-gcc-download-ci, r=marcoieni
Zalathar Jan 10, 2026
27cd10c
Rollup merge of #150878 - bpf_staticlib_error, r=Urgau
Zalathar Jan 10, 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
Prev Previous commit
Next Next commit
Use all thread::current static variables from realstd in tests.
  • Loading branch information
Sinan Nalkaya committed Jan 5, 2026
commit 2b76903b8fbb41377e4238c6be65a57ed75e8bcc
19 changes: 18 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,18 @@
#![allow(unused_features)]
//
// Features:
#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count, rt))]
#![cfg_attr(
test,
feature(
internal_output_capture,
print_internals,
update_panic_count,
rt,
thread_current_internals,
thread_local_internals,
thread_local_internal_pointer
)
)]
#![cfg_attr(
all(target_vendor = "fortanix", target_env = "sgx"),
feature(slice_index_methods, coerce_unsized, sgx_platform)
Expand Down Expand Up @@ -361,6 +372,7 @@
#![feature(str_internals)]
#![feature(sync_unsafe_cell)]
#![feature(temporary_niche_types)]
#![feature(test_internals)]
#![feature(ub_checks)]
#![feature(used_with_arg)]
// tidy-alphabetical-end
Expand Down Expand Up @@ -758,3 +770,8 @@ mod sealed {
#[cfg(test)]
#[allow(dead_code)] // Not used in all configurations.
pub(crate) mod test_helpers;

#[doc(hidden)]
#[unstable(feature = "test_internals", issue = "none")]
#[cfg(not(test))]
pub mod test_internals;
6 changes: 5 additions & 1 deletion library/std/src/sys/thread_local/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,17 @@ pub macro thread_local_inner {
pub(crate) macro local_pointer {
() => {},
($vis:vis static $name:ident; $($rest:tt)*) => {

#[doc(hidden)]
#[unstable(feature = "thread_local_internal_pointer", issue = "none")]
#[thread_local]
$vis static $name: $crate::sys::thread_local::LocalPointer = $crate::sys::thread_local::LocalPointer::__new();
$crate::sys::thread_local::local_pointer! { $($rest)* }
},
}

pub(crate) struct LocalPointer {
#[allow(missing_debug_implementations)]
pub struct LocalPointer {
p: Cell<*mut ()>,
}

Expand Down
5 changes: 4 additions & 1 deletion library/std/src/sys/thread_local/no_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,15 @@ unsafe impl<T> Sync for LazyStorage<T> {}
pub(crate) macro local_pointer {
() => {},
($vis:vis static $name:ident; $($rest:tt)*) => {
#[doc(hidden)]
#[unstable(feature = "thread_local_internal_pointer", issue = "none")]
$vis static $name: $crate::sys::thread_local::LocalPointer = $crate::sys::thread_local::LocalPointer::__new();
$crate::sys::thread_local::local_pointer! { $($rest)* }
},
}

pub(crate) struct LocalPointer {
#[allow(missing_debug_implementations)]
pub struct LocalPointer {
p: Cell<*mut ()>,
}

Expand Down
5 changes: 4 additions & 1 deletion library/std/src/sys/thread_local/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,15 @@ unsafe extern "C" fn destroy_value<T: 'static, const ALIGN: usize>(ptr: *mut u8)
pub(crate) macro local_pointer {
() => {},
($vis:vis static $name:ident; $($rest:tt)*) => {
#[doc(hidden)]
#[unstable(feature = "thread_local_internal_pointer", issue = "none")]
$vis static $name: $crate::sys::thread_local::LocalPointer = $crate::sys::thread_local::LocalPointer::__new();
$crate::sys::thread_local::local_pointer! { $($rest)* }
},
}

pub(crate) struct LocalPointer {
#[allow(missing_debug_implementations)]
pub struct LocalPointer {
key: LazyKey,
}

Expand Down
21 changes: 21 additions & 0 deletions library/std/src/test_internals.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// A collection of common re-exports to be used by the test version of this crate.
pub use crate::thread::current::CURRENT as CURRENT_THREAD;

cfg_select! {
target_thread_local => {
pub use crate::thread::current::id::ID as CURRENT_THREAD_ID;
}
target_pointer_width = "16" => {
pub use crate::thread::current::id::ID0 as CURRENT_THREAD_ID0;
pub use crate::thread::current::id::ID16 as CURRENT_THREAD_ID16;
pub use crate::thread::current::id::ID32 as CURRENT_THREAD_ID32;
pub use crate::thread::current::id::ID48 as CURRENT_THREAD_ID48;
}
target_pointer_width = "32" => {
pub use crate::thread::current::id::ID0 as CURRENT_THREAD_ID0;
pub use crate::thread::current::id::ID32 as CURRENT_THREAD_ID32;
}
_ => {
pub use crate::thread::current::id::ID as CURRENT_THREAD_ID;
}
}
84 changes: 65 additions & 19 deletions library/std/src/thread/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,73 @@ use super::thread::Thread;
use crate::mem::ManuallyDrop;
use crate::ptr;
use crate::sys::thread as imp;
use crate::sys::thread_local::local_pointer;

const NONE: *mut () = ptr::null_mut();
const BUSY: *mut () = ptr::without_provenance_mut(1);
const DESTROYED: *mut () = ptr::without_provenance_mut(2);

local_pointer! {
static CURRENT;
cfg_select! {
test => {
use realstd::test_internals::CURRENT_THREAD as CURRENT;
}
_ => {
use crate::sys::thread_local::local_pointer;

local_pointer! {
pub static CURRENT;
}
}
}

/// Persistent storage for the thread ID.
///
/// We store the thread ID so that it never gets destroyed during the lifetime
/// of a thread, either using `#[thread_local]` or multiple `local_pointer!`s.
pub(super) mod id {
pub mod id {
use super::*;

cfg_select! {
target_thread_local => {
use crate::cell::Cell;
cfg_select! {
test => {
use realstd::test_internals::CURRENT_THREAD_ID as ID;
}
_ => {
use crate::cell::Cell;

#[thread_local]
static ID: Cell<Option<ThreadId>> = Cell::new(None);
#[thread_local]
pub static ID: Cell<Option<u64>> = Cell::new(None);

}
}
pub(super) const CHEAP: bool = true;

pub(crate) fn get() -> Option<ThreadId> {
ID.get()
ID.get().and_then(ThreadId::from_u64)
}

pub(super) fn set(id: ThreadId) {
ID.set(Some(id))
ID.set(Some(id.as_u64().get()))
}
}
target_pointer_width = "16" => {
local_pointer! {
static ID0;
static ID16;
static ID32;
static ID48;
cfg_select! {
test => {
use realstd::test_internals::CURRENT_THREAD_ID0 as ID0;
use realstd::test_internals::CURRENT_THREAD_ID16 as ID16;
use realstd::test_internals::CURRENT_THREAD_ID32 as ID32;
use realstd::test_internals::CURRENT_THREAD_ID48 as ID48;
}
_ => {
use crate::sys::thread_local::local_pointer;

local_pointer! {
pub static ID0;
pub static ID16;
pub static ID32;
pub static ID48;
}
}
}

pub(super) const CHEAP: bool = false;
Expand All @@ -65,9 +92,19 @@ pub(super) mod id {
}
}
target_pointer_width = "32" => {
local_pointer! {
static ID0;
static ID32;
cfg_select! {
test => {
use realstd::test_internals::CURRENT_THREAD_ID0 as ID0;
use realstd::test_internals::CURRENT_THREAD_ID32 as ID32;
}
_ => {
use crate::sys::thread_local::local_pointer;

local_pointer! {
pub static ID0;
pub static ID32;
}
}
}

pub(super) const CHEAP: bool = false;
Expand All @@ -85,8 +122,17 @@ pub(super) mod id {
}
}
_ => {
local_pointer! {
static ID;
cfg_select! {
test => {
use realstd::test_internals::CURRENT_THREAD_ID as ID;
}
_ => {
use crate::sys::thread_local::local_pointer;

local_pointer! {
pub static ID;
}
}
}

pub(super) const CHEAP: bool = true;
Expand Down
4 changes: 3 additions & 1 deletion library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ use crate::any::Any;
#[macro_use]
mod local;
mod builder;
mod current;
#[doc(hidden)]
#[unstable(feature = "thread_current_internals", issue = "none")]
pub(crate) mod current;
mod functions;
mod id;
mod join_handle;
Expand Down