Skip to content

Commit a8e4131

Browse files
author
gitbot
committed
Squashed 'library/' changes from 78fc550..0334198
0334198 [create-pull-request] automated change c4a46b7 Add real safety comments a905002 Go back to `Some` instead of transmuting to it. a51ccf8 Save another BB by using `SubUnchecked` instead of a call to `arith_offset` d8f13b3 Simplify `slice::Iter::next` enough that it inlines 74bf98c stabilize `inherent_str_constructors` 85a2e19 Synchronize platform adaptors for OsString/OsStr 6b234f7 Simplify control flow with while-let c62d2c0 Improve WTF-8 comments d1a2b1c Remove ignored `#[must_use]` attributes from portable-simd ba39cf0 Use more explicit and reliable ptr select in sort impls 3c8c8e2 Impl TryFrom<Vec<u8>> for String d59a876 add MAX_LEN_UTF8 and MAX_LEN_UTF16 constants 44d3e34 Stabilize file_lock 515fc2e Update library/std/src/fs.rs 1f4899b Update fs.rs ae41b93 Improve instant docs 2680b68 Stabilize const_slice_flatten d2521bc Fix typo in hidden internal docs of `TrustedRandomAccess` 505a1db Stabilize (and const-stabilize) `integer_sign_cast` 85e402c fix docs for inherent str constructors fc4fd3b Reorder "This lock may be advisory or mandatory." earlier in the lock docs 1bb295a Clarify that locking on Windows also works for files opened with `.read(true)` ac1b8ea Document that locking a file fails on Windows if the file is opened only for append 6782190 Reword file lock documentation to clarify advisory vs mandatory 893839a add last std diagnostic items for clippy 9fe471c Remove std::os::wasi::fs::FileExt::tell ebdad11 tests: Also gate `f16::erfc()` doctest with `reliable_f16_math` cfg 09fc057 Make ub_check message clear that it's not an assert 973aa1e Use tell for <File as Seek>::stream_position 3312816 Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str. 180a41f invalid_from_utf8[_unchecked]: also lint inherent methods 5fd54a6 Fix &&str and trailing commas in io::const_error! 3a69d9c Use io::const_error! when possible over io::Error::new ef2c13a Add an example for std::error::Error e0d3c4e proc_macro: Apply unsafe_op_in_unsafe_fn 02a2662 std: Apply unsafe_op_in_unsafe_fn 0ae5831 Fix safety of windows uwp functions 4739c23 unwind: Apply unsafe_op_in_unsafe_fn c0d436e panic_unwind: Apply unsafe_op_in_unsafe_fn b46e363 panic_abort: Apply unsafe_op_in_unsafe_fn 10933a3 core: Apply unsafe_op_in_unsafe_fn 2939cb3 docs: fix broken intra-doc links that never worked 2a61446 Forward all default methods for I/O impls 54955f9 Windows: Update generated bindings to 0.59 9039d78 Add safe new to NotAllOnes b29c98f Implement Extend<AsciiChar> for String 68de3ba re-export `core::iter::FromCoroutine` 12e28b3 Implement `f{16,32,64,128}::{erf,erfc}` 154d4e6 std: Apply deprecated_safe_2024 44a1662 test: Apply deprecated_safe_2024 1572f28 std: Apply fixes for tail drop expressions 8169ff1 std: Apply rust_2024_incompatible_pat 64bb216 std: Apply dependency_on_unit_never_type_fallback 33c0a74 std: Apply missing_unsafe_on_extern 87380e9 std: Apply unsafe_attr_outside_unsafe e4d84b8 alloc: Apply missing_unsafe_on_extern 2ce50f9 alloc: Apply unsafe_attr_outside_unsafe 805dd83 alloc: Workaround hidden doctest line b0d8caa Migrate coretests to Rust 2024 2431e2b library: Update rand to 0.9.0 6a90680 core: Apply unsafe_attr_outside_unsafe 7186606 Const-stabilize `str::is_char_boundary` and `str::split_at(_mut)(_checked)`. 4911082 alloc boxed: docs: use MaybeUninit::write instead of as_mut_ptr 610f633 Use `slice::fill` in `io::Repeat` implementation 3f78ea3 Remove the common prelude module d42780a Correct comment for FreeBSD and DragonFly BSD in unix/thread d7d767f `transmute` should also assume non-null pointers e5ba4a0 Update backtrace f0dc10d expect EINVAL for pthread_mutex_destroy for aix 6cf7293 add `IntoBounds` trait 01ca582 Stabilize `get_many_mut` as `get_disjoint_mut` 36eb710 Fix import in bench for wasm af9e9df Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validity 8d2b081 Add diagnostic item for `std::io::BufRead` d9107ce Implement `read*_exact` for `std:io::repeat` 48258c1 std: replace the `FromInner` implementation for addresses with private conversion functions 621b3b4 Stabilize target_feature_11 16b66e1 Change swap_nonoverlapping from lang to library UB 9081fba `f128` is quadruple-precision 6aeb0c8 `f16` is half-precision ae732e0 library: amend revert of extended_varargs_abi_support for beta diff 6efd6e6 Revert "Stabilize `extended_varargs_abi_support`" 52294cb Change the issue number for `likely_unlikely` and `cold_path` 9097bfd Update docs for impl keyword fb2d05f include note on variance and example 8102b0d Improve examples for file locking 6273b89 library: doc: core::alloc::Allocator: trivial typo fix 0dc4755 stabilize `NonZero::count_ones` b8e59c1 Fix long lines which rustfmt fails to format 271fc3e Reword doc comment on `CoercePointeeValidated` 8d66926 block coerce_pointee_validated for stabilization fe3e5e2 rename the trait to validity and place a feature gate afront 9d60701 introduce CoercePointeeWellformed for coherence checks at typeck stage eeb5631 Update `compiler-builtins` to 0.1.146 63cbbdd Merge commit '3383cfbd3572465febc7a8f816a46304373de46a' into sync-from-portable-simd-2025-01-18 c50586e ignore win_delete_self test in Miri baf20ec Fix pattern matching mode changes and unsafe_op_in_unsafe_fn a916129 Mark extern blocks as unsafe b025a62 Rename field in OnceWith from gen to make 999db80 Mark link_section attr with unsafe 0ab999e Use Option for FindNextFileHandle dcbec53 fix(libtest): Enable Instant on Emscripten targets 10999e7 Simplify Rc::as_ptr docs + typo fix e3dfa56 Stabilize `vec_pop_if` 3bf09fd Rustfmt 1bd8b97 occured -> occurred 10c452c Allow Rust to use a number of libc filesystem calls 02ee164 Windows: Test that deleting a running binary fails 49d1b4d Update platform information for remove_file 22588a8 Windows: remove readonly files 7c034e8 Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]` eda1ad0 Document `Sum::sum` returns additive identities for `[]` 9ff885a Clean up 'HashMap' and 'HashSet' docs; 9b73ae6 Optimize `Rc::<str>::default()` implementation 306b196 std: get rid of `sys_common::io` fb701b3 std: move `io` module out of `pal` 7857718 Move two windows process tests to tests/ui e9999ba tests(std/net): remove outdated `base_port` calculation 645d856 sys: net: Add UEFI stubs e19fd76 Remove some unnecessary parens in `assert!` conditions f712b4e remove use of `feature(trait_upcasting)` from core tests 5b4acbc Stabilise 'Cursor::{get_mut, set_position}' in 'const' scenarios; 2a04d4d Stabilize `HashMap::get_many_mut` as `HashMap::get_disjoint_mut` 1400a93 tests(std): don't output to std{out,err} in `test_creation_flags` and `test_proc_thread_attributes` 35daf4e Fix unreachable_pub lint for hermit target 229331e Fix link in from_fn.rs 66bb0cc Use `widening_mul` a9a4ca5 Add OneSidedRangeBound to eliminate panic in `split_point_of` af48aaa Rename slice::take methods to split_off 8bdc6b9 Update `compiler-builtins` to 0.1.145 ad772c3 specify a prim@slice in docs e73fe3b implement inherent str constructors acd3689 std: move network code into `sys` 8c257f0 uefi: process: Add support for command environment variables 6845b6f Mark `std::fmt::from_fn` as `#[must_use]` 90ce3c7 Rename rustc_contract to contract d828e34 Improve contracts intrisics and remove wrapper function def00c0 Separate contract feature gates for the internal machinery 11c72a0 Desugars contract into the internal AST extensions 7ff89a0 Express contracts as part of function header and lower it to the contract lang items cbb29d7 contracts: added lang items that act as hooks for rustc-injected code to invoke. da2e7fc Contracts core intrinsics. aba5a65 More PR feedback 3f63c83 PR feedback f528277 Add `unchecked_disjoint_bitor` with fallback intrinsic implementation df32034 Add note about `FnPtr` being exposed as public bound d6a6379 Add `cast_signed` and `cast_unsigned` methods for `NonZero` types 4c07059 For NonZero impl macros, give unsigned impls access to the corresponding signed type cce76ab std::fs: further simplify dirent64 handling b395565 add UnsafeCell direct access APIs dc50a50 primitive type migration from mod.rs to primitives.rs c2a7b8a implement unstable `new_range` feature 988ce24 std::range 6f4d7d1 Remove stabilized feature gate 41b4f2e Move env modifying tests to a separate integration test ce71b18 Fix for SGX ca9311a Fix benchmarking of libstd 8b0de2b Move std::sync unit tests to integration tests e81009b Move std::thread_local unit tests to integration tests 02bb199 Move std::time unit tests to integration tests af9739c Move std::path unit tests to integration tests 0e4b8a4 Move std::panic unit tests to integration tests ff7c358 Move std::num unit tests to integration tests b4483f2 Move std float unit tests to integration tests 5a93f72 Move std::error unit tests to integration tests 9c178fb Move std::env unit tests to integration tests 476872d no unsafe pointer and no overflowing_literals in fmt::Display of integers 2f49d8e black_box integer-input on fmt benches d4ea809 OnceCell & OnceLock docs: Using (un)initialized consistently 2ddcc67 Docs for f16 and f128: correct a typo and add details 1893027 rustc_allowed_through_unstable_modules: require deprecation message 619be3a Update encode_utf16 to mention it is native endian 125834d remove Rustc{En,De}codable from library and compiler ade6039 make rustc_encodable_decodable feature properly unstable 1b6520a Fix sentence in process::abort 83d1e84 document ptr comparison being by address 908de7a stabilize `once_wait` 0b7197e implement all min/max fns in terms of `<`/`is_lt` e0cd93d improve doc tests for (min/max/minmax).* functions 02ed173 docs: Documented Send and Sync requirements for Mutex + MutexGuard 7170b0d Add documentation for derive(CoercePointee) 1e3f675 Fix off-by-one error causing driftsort to crash 6458b1b Insert null checks for pointer dereferences when debug assertions are enabled e3238d1 atomic: extend compare_and_swap migration docs a271348 float::min/max: mention the non-determinism around signed 0 dad81fe Stabilize `const_black_box` 474a7ff Improve documentation for file locking 6e313fd Remove minor future footgun in `impl Debug for MaybeUninit` ab22580 Add `AsyncFn*` to core prelude f03a0c7 uefi: Implement path d11eed8 Implement `int_from_ascii` (rust-lang#134821) 577c9a4 Cleanup docs for Allocator 27bd1ec btree/node.rs: pop_internal_level: does not invalidate other handles aa145bb btree/node.rs: remove incorrect comment from pop_internal_level docs 51faf7f add inline attribute and codegen test 80b571d split slice::ptr_rotate into three separate algorithms, to hopefully help inlining fda3bb7 optimize slice::ptr_rotate for compile-time-constant small rotates 3d0802f Test pipes also when not running on Windows and Linux simultaneously be05ab8 uefi: process: Fix args ae94901 [cfg_match] Document the use of expressions 84b4bf1 Update comments and sort target_arch in c_char_definition 7abc1e6 [Clippy] Add vec_reserve & vecdeque_reserve diagnostic items 5c30cc6 Fix platform-specific doc string for AtomicUsize::from_mut to be platform-independent 708d2b0 Document powf and powi calls that always return 1.0 6096310 Document purpose of closure in from_fn.rs more clearly a41e6f0 add missing allocator safety in alloc crate f48f334 alloc: add `#![warn(unreachable_pub)]` 626eb75 Implement `AtomicT::update` & `AtomicT::try_update` 63f231b fix doc for std::sync::mpmc 0c11132 Implement phantom variance markers e213867 Clarify WindowsMut (Lending)Iterator 11bb121 compiler_fence: fix example 9bd8888 Update `std::io::{pipe, PipeReader, PipeWriter}` docs the new location 281b1fa Move `std::io::pipe` code into its own file 48b1b91 Actually run the bstr test 1e15a31 Update comment b8408b0 Put all coretests in a separate crate e784a55 Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls 1f50db3 add nto80 x86-64 and aarch64 target 1e72726 Add support for QNX 7.1 with io-sock on x64 8855f2c Add new target for supporting Neutrino QNX 6.1 with `io-socket` network stack on aarch64 6118e51 Update a bunch of comments from before wasi support was added 8e1512e Remove a bunch of emscripten test ignores 894d0cd Fix testing of the standard library with Emscripten 9307f86 fix(libtest): Deprecate '--logfile' 4a20832 docs: fix typo in std::pin overview 045ee02 ports last few library files to new intrinsic style 4956e16 Improve and expand documentation of pipes 07508b0 Fix set_name in thread mod for NuttX 943b6fa Fix `FormattingOptions` instantiation with `Default` 46ead06 Update library/core/src/num/nonzero.rs 4e4c210 Add memory layout documentation to generic NonZero<T> 2b2a836 Fix whitespace 041303a document order of items in iterator from drain 17f4371 Add `File already exists` error doc to `hard_link` function 9825a63 Doc difference between extend and extend_from_slice e4a4fa2 Make `Vec::pop_if` a bit more presentable 8096346 Implement `VecDeque::pop_front_if` & `VecDeque::pop_back_if` 6368b40 remove pointless allowed_through_unstable_modules on TryFromSliceError 22fd023 test: add `#![warn(unreachable_pub)]` 1a92893 proc_macro: add `#![warn(unreachable_pub)]` 965927e Implement `CloneToUninit` for `ByteStr` e4a5f24 Add doc aliases for BStr and BString 5e9533b Omit some more `From` impls to avoid inference failures b8702ce Support `no_rc`, `no_sync`, and `no_global_oom_handling` 880038b Add `#[cfg(not(test))]` to some impls to work around rust-lang#135100 3083d6e Implement `ByteStr` and `ByteString` types 2a4d70d Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut` 610c8ad Library: Finalize dyn compatibility renaming 8b64658 Remove test panic from File::open de8b8f3 fix OsString::from_encoded_bytes_unchecked description 93a1369 Add an example of using `carrying_mul_add` to write wider multiplication b8e2b49 Outline panicking code for `LocalKey::with` 3db6fa9 core: `#[allow(unreachable_pub)]` on unreachable `pub use` bef9296 core: add `#![warn(unreachable_pub)]` f3a3721 rtstartup: add `#![warn(unreachable_pub)]` 174446a panic_unwind: add `#![warn(unreachable_pub)]` b6e2d54 Recognise new IPv6 documentation range from RFC9637 6fe5a42 1. Removed 'rustc_nounwind' 2. Rewording of comments a58bedb Export likely(), unlikely() and cold_path() in std::hint 64d46ca Correct counting to four in cell module docs 9aba303 doc: Point to methods on `Command` as alternatives to `set/remove_var` 3e9bb2d wasi/io: remove dead files f150009 remove unnecessary rustc_allowed_through_unstable_modules 7796573 further improve panic_immediate_abort by removing rtprintpanic messages 4091e80 cargo update 4d65ba2 Rewrap following accepting review suggestions from @ibraheemdev 38c2bdb Update library/core/src/slice/mod.rs 89fea1f Update library/core/src/slice/mod.rs ede0509 Update library/core/src/slice/mod.rs 1a8b376 Update library/core/src/slice/mod.rs 29930e3 Update library/core/src/slice/mod.rs 9558aa5 Update library/core/src/slice/mod.rs 589c751 Update library/core/src/slice/mod.rs 6dafb43 Update library/core/src/slice/mod.rs e34f178 Update library/core/src/slice/mod.rs a06ea4f Update library/core/src/slice/mod.rs 1589d1a `then be` -> `be` based on feedback from @ibraheemdev d8a7052 Improve `select_nth_unstable` documentation clarity 699b41a Revert "Auto merge of rust-lang#134330 - scottmcm:no-more-rvalue-len, r=matthewjasper" d6ad993 Add references to the IEEE functions for `float_next_up_down` 0730855 Stabilize `float_next_up_down` e2f2ffd Fix import of pipe in kernel_copy.rs 662f914 Move `std::pipe::*` into `std::io` aa14622 Clarify note in `std::sync::LazyLock` example b356caf fix typo in library/alloc/src/sync.rs 6659d6c Add missing safety descriptions to Arc's 'from_raw','increment_strong_count','decrement_strong_count' a403194 Adjust syntax 72ba1e1 Less unsafe in `dangling`/`without_provenance` 3f5ffef fix typo in typenames of pin documentation 8cd6d3c intrinsics: deprecate calling them via the unstable std::intrinsics path 712ac63 add comments explaining main thread identification cf32d27 std: lazily allocate the main thread handle d2034e0 Revert "Remove the Arc rt::init allocation for thread info" 4fc45c0 Update ReadDir::next in std::sys::pal::unix::fs to use `&raw const (*ptr).field` instead of `ptr.offset(...).cast()`. e4e000b Update compiler-builtins to 0.1.143 2a42bf2 Rename `pos` to `position` 2b5663b Convert `struct FromBytesWithNulError` into enum 5e82a37 Enforce syntactical stability of const traits in HIR 4df5fef Update compiler-builtins to 0.1.141 d43dffa Add another `Vec::splice` example ccbebe5 avoid nesting the user-defined main so deeply on the stack ed4260b use a single large catch_unwind in lang_start 2aa9e78 uefi: helpers: Introduce OwnedDevicePath 737cdee path: Move is_absolute check to sys::path 9a28ea3 Update the explanation for why we use box_new in vec! 6a1de78 Add #[inline] to copy_from_slice 7e1899b Add inherent versions of MaybeUninit methods for slices 04429be Make UniqueRc invariant for soundness eb159d4 update and clarify StructuralPartialEq docs 6975806 Use `NonNull::without_provenance` within the standard library d2b3ec8 Initial fs module for uefi 44c499a Improve the safety documentation on new_unchecked 427cffe Update a bunch of library types for MCP807 a42dfa6 alloc: remove unsound `IsZero` for raw pointers 0083db4 Fix `proc_macro::quote!` for raw ident 64fe7f5 Append `TokenTree` with `ToTokens` in `proc_macro::quote!` ddd9872 Rename the internal simpler `quote` macro to `minimal_quote` 4ee26f6 Used pthread name functions returning result for FreeBSD and DragonFly d45f7ab Fix ptr::from_ref documentation example comment 03b31aa Improve prose around `as_slice` example of IterMut 5275a29 fmt e9f22b4 update cfg(bootstrap) 6a6073d update version placeholders 110b7ff Remove some unnecessary `.into()` calls be9a7b5 add missing provenance APIs on NonNull 8b19c55 More compelling env_clear() examples 5bee13d Implement Condvar::wait_timeout for targets without threads d992c60 Impl String::into_chars c4df4d5 Avoid naming variables `str` 8581711 [generic_assert] Constify methods used by the formatting system 360fddc Add support for wasm exception handling to Emscripten target 8a08cf8 chore: remove redundant words in comment 0b74d9c Add doc aliases for `libm` and IEEE names 3f62e9f Mark `slice::reverse` unstably const 66329ed Clarified the documentation on core::iter::from_fn and core::iter::successors 6e77244 library: fix adler{-> 2}.debug e814cd4 add regression test for unsound Flatten/FlatMap specialization 54659a6 do not in-place-iterate over flatmap/flatten 5276cd8 Fix UWP build 92a45d6 Bump backtrace to 0.3.75 da838af sync to actual dep verions of backtrace 22ea2b8 turn rustc_box into an intrinsic 31898f1 core: use public method instead of instrinsic f71c350 core: improve comments 4645459 core: implement `bool::select_unpredictable` 427242c Switch rtems target to panic unwind deaeb04 path in detail 1817472 Move some things to `std::sync::poison` and reexport them in `std::sync` 4e9b4ff Bump backtrace to rust-lang/backtrace-rs@4d7906b bb3dbf8 Try to write the panic message with a single `write_all` call d8fe6cf fix doc for missing Box allocator consistency cf57ff2 Remove qualification of `std::cmp::Ordering` in `Ord` doc dd04978 std::fs::DirEntry.metadata(): prefer use of lstat() on Emscripten 72611f0 Avoid use of LFS64 symbols on Emscripten 822e589 char to_digit: avoid unnecessary casts to u64 faa730b Remove allowing static_mut_refs lint 16e89ec Tidy up bigint mul methods 0347158 fix doc for read write unaligned in zst operation 934f36a Avoid short writes in LineWriter 600b9b5 ptr docs: make it clear that we are talking only about memory accesses bb8efbe Make slice::as_flattened_mut unstably const c81a940 rename typed_swap → typed_swap_nonoverlapping e4960f7 stabilize const_swap 6c09e8d fix: typos ef43531 Fix sentence fragment in `pin` module docs 122ca20 docs: inline `alloc::ffi::c_str` types to `alloc::ffi` 220dc01 Fix compilation issues on other unixes 67d674b Eliminate redundant statx syscalls bfc18a0 Unify fs::copy and io::copy 8452c6c Update `compiler-builtins` to 0.1.140 2651185 Update library/alloc/tests/sort/tests.rs d77e074 Fix typos 70ce918 Override `carrying_mul_add` in cg_llvm 583edd7 Move `{widening, carrying}_mul` to an intrinsic with fallback MIR b0a22d5 Fix mistake in windows file open 32ba12d Windows: Use WriteFile to write to a UTF-8 console c09458a ptr::copy: fix docs for the overlapping case 1ea0561 Fix renaming symlinks on Windows 561b712 docs: inline `core::ffi::c_str` types to `core::ffi` 3da2079 docs: inline `std::ffi::c_str` types to `std::ffi` 9578530 unwinding: bump version to fix asm 0055b76 docs: update code example for Iterator#rposition ac41351 Use scoped threads in `std::sync::Barrier` examples a89d115 Fix forgetting to save statx availability on success 0d617e9 Specify only that duplicates are discarded, not the order. a15a42b Document collection `From` and `FromIterator` impls that drop duplicate keys. 01c3172 Add 'into_array' conversion destructors for 'Box', 'Rc', and 'Arc'; 31d7e6c Impl FromIterator for tuples with arity 1-12 ce8b43b Fix formatting 381e30d stabilize const_alloc_layout ee2d176 chore: fix typos 2eb94b8 Windows: Use FILE_ALLOCATION_INFO for truncation e53b69b Bump `stdarch` d184d60 core: fix const ptr::swap_nonoverlapping when there are pointers at odd offsets in the type c248458 Fixes safety docs for `dyn Any + Send {+ Sync}` a479ffb Use `#[derive(Default)]` instead of manually implementing it 884964f Revert "Auto merge of rust-lang#130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser" ad5ef5c Implement `PointerLike` for `isize`, `NonNull`, `Cell`, `UnsafeCell`, and `SyncUnsafeCell`. 654f7f9 docs: `transmute<&mut T, &mut MaybeUninit<T>>` is unsound when exposed to safe code 3a184c5 docs: Permissions.readonly() also ignores root user special permissions 174b696 cargo update ce02100 Delete `Rvalue::Len` 3104875 Asserts the maximum value that can be returned from `Vec::len` 0457d01 Document `PointerLike` implementation restrictions. 2c39220 Use `&raw` for `ptr` primitive docs 3869fb0 Add `is_ascii` function optimized for x86-64 for [u8] fde724b Add new implementation benchmark d7678ce Document CTFE behavior of methods that call is_null c0a996e Correctly document is_null CTFE behavior. 80dc926 Win: rename: Use offset_of! in struct size calculation 62ef2ce Win: Remove special casing of the win7 target for `std::fs::rename` d9622db Win: Add test cases for renaming a directory while the target file is opened and for renaming over a non-empty directory 16eeebc Win: Use `FILE_RENAME_FLAG_POSIX_SEMANTICS` for `std::fs::rename` if available 7b147a5 Less unwrap() in documentation 7625083 Improve prose around into_slice example of IterMut 5a16503 Improve prose around `as_slice` example of Iter 6366971 Improve prose around basic examples of Iter and IterMut 869f833 Abstract `ProcThreadAttributeList` into its own struct dda76a4 fix `PointerLike` docs 3d0d97a unimplement `PointerLike` for trait objects 408b5c1 split up `#[rustc_deny_explicit_impl]` attribute b3759dd remove reference to dangling from slice::Iter fc43853 mri: add track_caller to thread spawning methods for better backtraces 4cb8546 fix typos in the example code in the doc comments of `Ipv4Addr::from_bits()`, `Ipv6Addr::from_bits()` & `Ipv6Addr::to_bits()` 7aef526 Improve documentation of `element_offset` and related methods 9449efc Rename `elem_offset` to `element_offset` b439efe docs: Mention `spare_capacity_mut()` in `Vec::set_len` 2ec5f96 build: Update libc version faf10e6 fix typo in ptr/mod.rs 23302ae Stabilize `#[diagnostic::do_not_recommend]` 18f6150 Use field init shorthand where possible b5b5259 fix(LazyCell): documentation of get[_mut] was wrong b043a5e compiler & tools dependencies: Updating allocator-api2 v0.2.20 -> v0.2.21 Updating annotate-snippets v0.11.4 -> v0.11.5 Updating anyhow v1.0.93 -> v1.0.94 Updating bstr v1.11.0 -> v1.11.1 Updating chrono v0.4.38 -> v0.4.39 Updating clap v4.5.21 -> v4.5.23 Updating clap_builder v4.5.21 -> v4.5.23 Updating clap_complete v4.5.38 -> v4.5.39 Updating clap_lex v0.7.3 -> v0.7.4 Updating colored v2.1.0 -> v2.2.0 Updating console v0.15.8 -> v0.15.10 Updating crossbeam-channel v0.5.13 -> v0.5.14 Updating crossbeam-deque v0.8.5 -> v0.8.6 Updating crossbeam-utils v0.8.20 -> v0.8.21 Updating encode_unicode v0.3.6 -> v1.0.0 Updating fastrand v2.2.0 -> v2.3.0 Updating home v0.5.9 -> v0.5.11 Updating js-sys v0.3.74 -> v0.3.76 Updating libc v0.2.167 -> v0.2.168 Updating miniz_oxide v0.8.0 -> v0.8.1 Updating pest v2.7.14 -> v2.7.15 Updating pest_derive v2.7.14 -> v2.7.15 Updating pest_generator v2.7.14 -> v2.7.15 Updating pest_meta v2.7.14 -> v2.7.15 Updating redox_syscall v0.5.7 -> v0.5.8 Updating rustc-stable-hash v0.1.0 -> v0.1.1 Updating rustix v0.38.41 -> v0.38.42 Updating self_cell v1.0.4 -> v1.1.0 Updating semver v1.0.23 -> v1.0.24 Updating serde v1.0.215 -> v1.0.216 Updating serde_derive v1.0.215 -> v1.0.216 Adding thiserror v2.0.7 Adding thiserror-impl v2.0.7 Updating time v0.3.36 -> v0.3.37 Updating time-macros v0.2.18 -> v0.2.19 Updating tokio v1.41.1 -> v1.42.0 Updating wasm-bindgen v0.2.97 -> v0.2.99 Updating wasm-bindgen-backend v0.2.97 -> v0.2.99 Updating wasm-bindgen-macro v0.2.97 -> v0.2.99 Updating wasm-bindgen-macro-support v0.2.97 -> v0.2.99 Updating wasm-bindgen-shared v0.2.97 -> v0.2.99 Updating wasm-encoder v0.221.0 -> v0.221.2 Updating wasmparser v0.221.0 -> v0.221.2 Updating wast v221.0.0 -> v221.0.2 Updating wat v1.221.0 -> v1.221.2 33de924 Fix typo in uint_macros.rs fe64e63 remove obsolete comment and pub(super) visibility 33d598a remove bounds from vec and linkedlist ExtractIf 1dc8b27 Add a range argument to vec.extract_if ee3fcd3 Stabilize #[coverage] attribute ca66f82 Remove `rustc::existing_doc_keyword` lint. aa5222f Move `doc(keyword = "while")`. 35b97ab rustdoc-search: let From and Into be unboxed a56c9fd Replace i32 by char in `split_at` & `_unchecked` 1d65fe2 Add clarity to the "greater" of `VecDeque::insert` a9641d5 Replace i32 by char to add clarity d154b65 Add value accessor methods to `Mutex` and `RwLock` 8036e7e std::net: Solaris supports `SOCK_CLOEXEC` as well since 11.4. 1ea5d0b UniqueRc: platform-specific AsFd/Handle/etc impls to mirror Rc 76f0c6b UniqueRc: PinCoerceUnsized and DerefPure 347e854 UniqueRc: comparisons and Hash 6f52639 UniqueRc: Add more trait impls. 0602841 Remove support for specializing ToString outside the standard library 17a541f Correct spelling of CURRENT_RUSTC_VERSION cb86a19 Add documentation for anonymous pipe module f61f867 feat: clarify how to use `black_box()` e609172 Update includes in '/library/core/src/error.rs'; c3281ac Fix building `std` for Hermit after `c_char` change 6c812c4 Fix `Path::is_absolute` on Hermit 00fce71 Fix typos in docs on provenance 8898e55 Add unwrap_unsafe_binder and wrap_unsafe_binder macro operators df9a2d0 Switch inline(always) in core/src/fmt/rt.rs to plain inline 3e313b3 Reword prelude for AsyncFn stabilization c48d588 Stabilize async closures 9c63489 Remove consteval note from <*mut T>::align_offset docs. c95bf4b Stabilize the Rust 2024 prelude e586136 Forbid unsafe_op_in_unsafe_fn in hurd-specific os and sys files 254fbd9 Move some alloc tests to the alloctests crate b246283 control libunwind linkage mode via `crt-static` on gnullvm targets 6e23dd0 Change `GetManyMutError` to match T-libs-api decision 6967737 Add references to the specific ABI documents da396b6 Remove l4re from the unsigned char operating system list 3516142 De-duplicate and improve definition of core::ffi::c_char 77f027b Add a note saying that `{u8,i8}::from_{be,le,ne}_bytes` is meaningless 04ca2c5 stabilize const_nonnull_new 20f2ae7 Remove rustc_const_stable attribute on const NOOP 66a34a4 Add libc funcitons only for wasm32-wasip1-threads. cc9a676 Fix compilation for wasm32-wasip1 (without threads). 42ecd7f Use UNIX thread_local implementation for WASI. 89ac9c1 Run TLS destructors for wasm32-wasip1-threads 7735491 Downgrade cc f71f3e2 Run `cargo update` and update licenses 92611cb chore: Improve doc comments a7f9863 Refactor ReadDir into a state machine f625247 wasi/fs: Improve stopping condition for <ReadDir as Iterator>::next f2615af docs: better examples for `std::ops::ControlFlow` bf8542e Expand home_dir docs 5f4f3d4 Add doc alias 'then_with' for `then` method on `bool` 24c92b5 Adds new intrinsic declaration baaf1ab Define acronym for thread local storage fa4e16f Add a `collect_into` tuple test case 78cd764 Don't impl Extend for 13-tuples e2d61b4 Simplify documentation for Extend impl for tuples 3bcfa60 Add Extend impls for tuples of arity 1 through 12 b3f1b7c Unbreak tidy a0720d7 Stabilize `std::io::ErrorKind::QuotaExceeded` c00ebf9 Stabilize `std::io::ErrorKind::CrossesDevices` 542dc61 Access members of `FormattingOptions` directly instead of via getters/setters bdc7ce3 Removed constness for methods receiving a `&mut` parameter bb5fe86 Added better reason for exposing `flags` and `get_flags` as unstable c40ecf6 Formatted 58dfe87 Refactored FormattingOptions to use a bitmask for storing flags d1374fc Revert "Turned public+unstable+hidden functions into private functions" 7ed5235 Turned public+unstable+hidden functions into private functions d4cc0b0 Made all fns const 4aeb901 impl Default for fmt::FormattingOptions 5662b9b Fixed copy+paste error in comment c1ece7b fmt::FormattingOptions: Renamed `alignment` to `align` 496682a Formatter::with_options: Use different lifetimes 2bbdfd5 Fixed another broken test dbf82c2 Added struct `fmt::FormattingOptions` 5906c67 Formatter: Access members via getter methods wherever possible 19c123a Stabilize noop_waker 0c736ca Improve documentation a46ab4b Reformat Python code with `ruff` 4f77dc7 Improve comments for the default backtrace printer 7713538 clarify simd_relaxed_fma non-determinism 68e9c96 Teach rust core about Xtensa VaListImpl and add a custom lowering of vaarg for xtensa. 5e1ce66 Rename `core_pattern_type` and `core_pattern_types` lib feature gates to `pattern_type_macro` 8541cbc Allow fn pointers comparisons lint in library 964bcf5 Update `NonZero` and `NonNull` to not field-project (per MCP807) 9ea04ee Add `core::arch::breakpoint` and test 06d9c44 a release operation synchronizes with an acquire operation cf23bf8 Update the definition of `borrowing_sub` 1414e5d stabilize const_{size,align}_of_val cd39426 ./x miri: fix sysroot build 33c7095 stabilize const_collections_with_hasher and build_hasher_default_const_new c418d70 Match simd_relaxed_fma documentation to fmuladd intrinsic 500962a Add simd_relaxed_fma intrinsic 5524a9e Fix `f16::midpoint` const feature gate 589e9a1 Use c"lit" for CStrings without unwrap 2390af1 Stabilize `const_maybe_uninit_write` 73203b1 Fix docs for '<[T]>::as_array'; 982c99a Stabilize `ptr::fn_addr_eq` a2ce979 rustc_allow_const_fn_unstable is not used in proc_macro e6fbe09 get rid of a bunch of unnecessary rustc_const_unstable 14f6f52 remove a whole bunch of unnecessary const feature gates fef761b add isatty alias for is_terminal 9f490cf Stabilize unsigned `num_midpoint` feature 54e1b24 Mark `slice::copy_from_slice` unstably const 23f231a Fix chaining `carrying_add`s 64181fa add test for bytewise ptr::swap of a pointer 17d2db8 move swap_nonoverlapping constness to separate feature gate 3d22fb7 move slice::swap_unchecked constness to slice_swap_unchecked feature gate 1de9191 Add diagnostic item for `std::ops::ControlFlow` 22e3b30 update link to "C++ Exceptions under the hood" blog ccb4b0d fix: fix codeblocks in `PathBuf` example 075408b fix: hurd build, stat64.st_fsid was renamed to st_dev 7999b8c std: clarify comments about initialization 95e1897 std: refactor `pthread`-based synchronization 05b23ce bump hashbrown version c021db5 Fill in a `BTreeSet::entry` example 5ba075b Add a tracking issue for `btree_set_entry` a148417 Add `BTreeSet` entry APIs to match `HashSet` 8fcfc14 Implement code review b838b48 thread::available_parallelism for wasm32-wasip1-threads 6df12c7 changes old intrinsic declaration to new declaration 436d1e2 Fix and undeprecate home_dir() 5f6fffc refine mir debuginfo docs ee01a0a Doc comment custom MIR debuginfo. dd8a786 Stabilize `extended_varargs_abi_support` 72e52a3 update cfgs 2757573 replace placeholder version 2213705 Also use zero when referencing to capacity or length 6aee78e Use consistent wording in docs, use zero instead of 0 1f10a17 Fix typos in pin.rs 83752dd Share inline(never) generics across crates 8aa0548 fmt cc27be7 aix: create shim for lgammaf_r dd26dcd Add '<[T]>::as_array', '<[T]>::as_mut_array', '<*const [T]>::as_array', and '<*mut [T]>::as_mut_array' conversion methods; 5b5b6f7 Remove one stray space. bd42097 Update chown help with a link and adding cap warning cc41146 Expand std::os::unix::fs::chown() doc with a warning 844be12 Add missing code examples on `LocalKey` 74ede09 Make profiler_builtins `#![no_core]` instead of just `#![no_std]` dc5ad1f Remove unnecessary `#![allow(unused_features)]` 0e05370 Sort and separate lint/feature attributes in `profiler_builtins` c58bd15 std: update internal uses of `io::const_error!` 549c9a0 std: expose `const_io_error!` as `const_error!` a97dd5e Constify Drop and Destruct 09b2f0c miri: disable test_downgrade_observe test on macOS e92cd49 Shorten the `MaybeUninit` `Debug` implementation 7c1931d Support ranges in `<[T]>::get_many_mut()` dbec138 btree: add `{Entry,VacantEntry}::insert_entry` 5043513 std::thread: avoid leading whitespace in some panic messages 52c4398 Added a doc test for std::path::strip_prefix git-subtree-dir: library git-subtree-split: 0334198
1 parent 8fe8f56 commit a8e4131

File tree

750 files changed

+23425
-13874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

750 files changed

+23425
-13874
lines changed

Cargo.lock

+91-41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ resolver = "1"
33
members = [
44
"std",
55
"sysroot",
6+
"coretests",
67
]
78

89
exclude = [
@@ -32,7 +33,7 @@ codegen-units = 10000
3233
[profile.release.package]
3334
addr2line.debug = 0
3435
addr2line.opt-level = "s"
35-
adler.debug = 0
36+
adler2.debug = 0
3637
gimli.debug = 0
3738
gimli.opt-level = "s"
3839
miniz_oxide.debug = 0

alloc/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ edition = "2021"
1010

1111
[dependencies]
1212
core = { path = "../core" }
13-
compiler_builtins = { version = "=0.1.138", features = ['rustc-dep-of-std'] }
13+
compiler_builtins = { version = "=0.1.146", features = ['rustc-dep-of-std'] }
1414

1515
[dev-dependencies]
16-
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
17-
rand_xorshift = "0.3.0"
16+
rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
17+
rand_xorshift = "0.4.0"
1818

1919
[[test]]
2020
name = "alloctests"

alloc/benches/btree/map.rs

+13-12
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ macro_rules! map_insert_rand_bench {
99
($name: ident, $n: expr, $map: ident) => {
1010
#[bench]
1111
pub fn $name(b: &mut Bencher) {
12-
let n: usize = $n;
12+
let n: u32 = $n;
1313
let mut map = $map::new();
1414
// setup
1515
let mut rng = crate::bench_rng();
1616

1717
for _ in 0..n {
18-
let i = rng.gen::<usize>() % n;
18+
let i = rng.random::<u32>() % n;
1919
map.insert(i, i);
2020
}
2121

2222
// measure
2323
b.iter(|| {
24-
let k = rng.gen::<usize>() % n;
24+
let k = rng.random::<u32>() % n;
2525
map.insert(k, k);
2626
map.remove(&k);
2727
});
@@ -57,13 +57,13 @@ macro_rules! map_from_iter_rand_bench {
5757
($name: ident, $n: expr, $map: ident) => {
5858
#[bench]
5959
pub fn $name(b: &mut Bencher) {
60-
let n: usize = $n;
60+
let n: u32 = $n;
6161
// setup
6262
let mut rng = crate::bench_rng();
63-
let mut vec = Vec::with_capacity(n);
63+
let mut vec = Vec::with_capacity(n as usize);
6464

6565
for _ in 0..n {
66-
let i = rng.gen::<usize>() % n;
66+
let i = rng.random::<u32>() % n;
6767
vec.push((i, i));
6868
}
6969

@@ -102,11 +102,11 @@ macro_rules! map_find_rand_bench {
102102
#[bench]
103103
pub fn $name(b: &mut Bencher) {
104104
let mut map = $map::new();
105-
let n: usize = $n;
105+
let n: u32 = $n;
106106

107107
// setup
108108
let mut rng = crate::bench_rng();
109-
let mut keys: Vec<_> = (0..n).map(|_| rng.gen::<usize>() % n).collect();
109+
let mut keys: Vec<_> = (0..n).map(|_| rng.random::<u32>() % n).collect();
110110

111111
for &k in &keys {
112112
map.insert(k, k);
@@ -115,9 +115,9 @@ macro_rules! map_find_rand_bench {
115115
keys.shuffle(&mut rng);
116116

117117
// measure
118-
let mut i = 0;
118+
let mut i = 0u32;
119119
b.iter(|| {
120-
let t = map.get(&keys[i]);
120+
let t = map.get(&keys[i as usize]);
121121
i = (i + 1) % n;
122122
black_box(t);
123123
})
@@ -171,7 +171,7 @@ fn bench_iteration(b: &mut Bencher, size: i32) {
171171
let mut rng = crate::bench_rng();
172172

173173
for _ in 0..size {
174-
map.insert(rng.gen(), rng.gen());
174+
map.insert(rng.random(), rng.random());
175175
}
176176

177177
b.iter(|| {
@@ -201,7 +201,7 @@ fn bench_iteration_mut(b: &mut Bencher, size: i32) {
201201
let mut rng = crate::bench_rng();
202202

203203
for _ in 0..size {
204-
map.insert(rng.gen(), rng.gen());
204+
map.insert(rng.random(), rng.random());
205205
}
206206

207207
b.iter(|| {
@@ -353,6 +353,7 @@ pub fn iter_10k(b: &mut Bencher) {
353353
}
354354

355355
#[bench]
356+
#[cfg_attr(target_os = "emscripten", ignore)] // hits an OOM
356357
pub fn iter_1m(b: &mut Bencher) {
357358
bench_iter(b, 1_000, 1_000_000);
358359
}

0 commit comments

Comments
 (0)