about summary refs log tree commit diff
path: root/library/std/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2024-02-20Stabilize `LazyCell` and `LazyLock` (`lazy_cell`)Peter Jaszkowiak-1/+0
2024-05-23Replace fake "restricted-std" Cargo feature by custom cfgUrgau-2/+2
2024-05-20Remove Windows dependency on libcBen Kimock-0/+1
2024-05-01Step bootstrap cfgsMark Rousskov-2/+1
2024-04-28Auto merge of #124210 - the8472:consign-ebadf-to-the-fire, r=Mark-Simulacrumbors-0/+1
Abort a process when FD ownership is violated When an owned FD has already been closed before it's dropped that means something else touched an FD in ways it is not allowed to. At that point things can already be arbitrarily bad, e.g. clobbered mmaps. Recovery is not possible. All we can do is hasten the fire. Unlike the previous attempt in #124130 this shouldn't suffer from the possibility that FUSE filesystems can return arbitrary errors.
2024-04-26Auto merge of #123909 - dtolnay:utf8chunks, r=joboetbors-1/+0
Stabilize `Utf8Chunks` Pending FCP in https://github.com/rust-lang/rust/issues/99543. This PR includes the proposed modification in https://github.com/rust-lang/libs-team/issues/190 as agreed in https://github.com/rust-lang/rust/issues/99543#issuecomment-2050406568.
2024-04-24Stabilize Utf8ChunksDavid Tolnay-1/+0
2024-04-22export assert_unsafe_precondition macro for std-internal useThe 8472-0/+1
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-04-18Auto merge of #123144 - dpaoliello:arm64eclib, ↵bors-0/+1
r=GuillaumeGomez,ChrisDenton,wesleywiser Add support for Arm64EC to the Standard Library Adds the final pieces so that the standard library can be built for arm64ec-pc-windows-msvc (initially added in #119199) * Bumps `windows-sys` to 0.56.0, which adds support for Arm64EC. * Correctly set the `isEC` parameter for LLVM's `writeArchive` function. * Add `#![feature(asm_experimental_arch)]` to library crates where Arm64EC inline assembly is used, as it is currently unstable.
2024-04-17Stabilize `const_io_structs`Slanterns-1/+0
2024-04-15Add support for Arm64EC to the Standard LibraryDaniel Paoliello-0/+1
2024-04-14Replace libc::c_int with core::ffi::c_intChris Denton-0/+3
And remove the libc crate when it isn't needed
2024-04-13Rollup merge of #123868 - eduardosm:stabilize-slice_ptr_len, r=jhprattJacob Pratt-1/+0
Stabilize (const_)slice_ptr_len and (const_)slice_ptr_is_empty_nonnull Stabilized API: ```rust impl<T> *mut [T] { pub const fn len(self) -> usize; pub const fn is_empty(self) -> bool; } impl<T> *const [T] { pub const fn len(self) -> usize; pub const fn is_empty(self) -> bool; } impl<T> NonNull<[T]> { pub const fn is_empty(self) -> bool; } ``` FCP completed in tracking issue: https://github.com/rust-lang/rust/issues/71146
2024-04-12Stabilize (const_)slice_ptr_len and (const_)slice_ptr_is_empty_nonnullEduardo Sánchez Muñoz-1/+0
2024-04-12fix typo in library/std/src/lib.rskamaboko123-1/+1
2024-04-11Rollup merge of #123360 - adamgemmell:dev/adagem01/restricted-std, r=ehussLeón Orell Valerian Liehr-1/+10
Document restricted_std This PR aims to pin down exactly what restricted_std is meant to achieve and what it isn't. This commit fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/87 by explaining why the error appears and what the choices the user has. The error describes how std cannot function without knowing about some form of OS/platform support. Any features of std that work without an OS should be moved to core/alloc (see https://github.com/rust-lang/rust/issues/27242 https://github.com/rust-lang/rust/issues/103765). Note that the message says "platform" and "environment" because, since https://github.com/rust-lang/rust/pull/120232, libstd can be built for some JSON targets. This is still unsupported (all JSON targets probably should be unstable https://github.com/rust-lang/wg-cargo-std-aware/issues/90), but a JSON target with the right configuration should hopefully have some partial libstd support. I propose closing https://github.com/rust-lang/wg-cargo-std-aware/issues/69 as "Won't fix" since any support of std without properly configured os, vendor or env fields is very fragile considering future upgrades of Rust or dependencies. In addition there's no likely path to it being fixed long term (making std buildable for all targets being the only solution). This is distinct from tier 3 platforms with limited std support implemented (and as such aren't restricted_std) because these platforms can conceptually work in the future and std support should mainly improve over time. The alternative to closing https://github.com/rust-lang/wg-cargo-std-aware/issues/69 is a new crate feature for std which escapes the restricted_std mechanism in build.rs. It could be used with the -Zbuild-std-features flag if we keep it permanently unstable, which I hope we can do anyway. A minor side-effect in this scenario is that std wouldn't be marked as unstable if documentation for it were generated with build-std. cc ```@ehuss```
2024-04-10Add basic f16 and f128 modulesTrevor Gross-0/+6
Create empty modules so `rustdoc` has someplace to link to for these types.
2024-04-08Add pattern types to parserOli Scherer-0/+3
2024-04-06remove miri-test-libstd hacks that are no longer neededRalf Jung-7/+1
2024-04-02Document restricted_stdAdam Gemmell-1/+10
This PR aims to pin down exactly what restricted_std is meant to achieve and what it isn't. This commit fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/87 by explaining why the error appears and what the choices the user has. The error describes how std cannot function without knowing about some form of OS/platform support. Any features of std that work without an OS should be moved to core/alloc (see https://github.com/rust-lang/rust/issues/27242 https://github.com/rust-lang/rust/issues/103765). Note that the message says "platform" and "environment" because, since https://github.com/rust-lang/rust/pull/120232, libstd can be built for some JSON targets. This is still unsupported (all JSON targets probably should be unstable https://github.com/rust-lang/wg-cargo-std-aware/issues/90), but a JSON target with the right configuration should hopefully have some partial libstd support. I propose closing https://github.com/rust-lang/wg-cargo-std-aware/issues/69 as "Won't fix" since any support of std without properly configured os, vendor or env fields is very fragile considering future upgrades of Rust or dependencies. In addition there's no likely path to it being fixed long term (making std buildable for all targets being the only solution). This is distinct from tier 3 platforms with limited std support implemented (and as such aren't restricted_std) because these platforms can conceptually work in the future and std support should mainly improve over time. The alternative to closing https://github.com/rust-lang/wg-cargo-std-aware/issues/69 is a new crate feature for std which escapes the restricted_std mechanism in build.rs. It could be used with the -Zbuild-std-features flag if we keep it permanently unstable, which I hope we can do anyway. A minor side-effect in this scenario is that std wouldn't be marked as unstable if documentation for it were generated with build-std.
2024-03-29stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gateAria Beingessner-1/+1
This is an alternative to #121920
2024-03-27Eliminate `UbCheck` for non-standard librariesDianQK-0/+1
2024-03-24panic-in-panic-hook: formatting a message that's just a string is risk-freeRalf Jung-0/+1
2024-03-20step cfgsMark Rousskov-3/+1
2024-03-12Use `min_exhaustive_patterns` in core & stdNadrieril-1/+2
2024-03-10Rollup merge of #112136 - clarfonthey:ffi-c_str, r=cuviperMatthias Krüger-0/+1
Add std::ffi::c_str module ACP: rust-lang/libs-team#134 `std::ffi` docs before change: ![Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString](https://github.com/rust-lang/rust/assets/15850505/b2cf3534-30f9-4ef0-a655-bacdc3a19e17) `std::ffi` docs after change: ![Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString](https://github.com/rust-lang/rust/assets/15850505/23aa6964-da7a-4942-bbf7-42bde2146f9e) (note: I'm omitting the `c_int`, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)
2024-03-07Rust is a proper name: rust → RustRalf Jung-1/+1
2024-02-25remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsicsRalf Jung-1/+1
2024-02-22Add std::ffi::c_str modulesltdk-0/+1
2024-02-16Auto merge of #120889 - Ayush1325:uefi-instant, r=joshtriplettbors-0/+4
Implement Instant for UEFI - Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64
2024-02-13Implement Instant for UEFIAyush Singh-0/+4
- Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64 Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-12Auto merge of #110211 - joboet:queue_lock, r=Amanieubors-0/+2
Replace pthread `RwLock` with custom implementation This is one of the last items in #93740. I'm doing `RwLock` first because it is more self-contained and has less tradeoffs to make. The motivation is explained in the documentation, but in short: the pthread rwlock is slow and buggy and `std` can do much better. I considered implementing a parking lot, as was discussed in the tracking issue, but settled for the queue-based version because writing self-balancing binary trees is not fun in Rust... This is a rather complex change, so I have added quite a bit of documentation to help explain it. Please point out any part that could be explained better. ~~The read performance is really good, I'm getting 4x the throughput of the pthread version and about the same performance as usync/parking_lot on an Apple M1 Max in the usync benchmark suite, but the write performance still falls way behind what usync and parking_lot achieve. I tried using a separate queue lock like what usync uses, but that didn't help. I'll try to investigate further in the future, but I wanted to get some eyes on this first.~~ [Resolved](https://github.com/rust-lang/rust/pull/110211#issuecomment-1513682336) r? `@m-ou-se` CC `@kprotty`
2024-02-09std: replace pthread `RwLock` with custom implementation inspired by usyncjoboet-0/+2
2024-02-08Step all bootstrap cfgs forwardMark Rousskov-1/+1
This also takes care of other bootstrap-related changes.
2024-02-05Auto merge of #117372 - Amanieu:stdarch_update, r=Mark-Simulacrumbors-6/+14
Update stdarch submodule Splits up #27731 into multiple tracking issues. Closes #27731
2024-01-30Add stdarch_wasm_atomic_wait feature in stdAmanieu d'Antras-0/+1
2024-01-30Update feature names for new stdarchAmanieu d'Antras-6/+8
2024-01-30Update stdarch submoduleAmanieu d'Antras-0/+5
2024-01-29Remove `raw_os_nonzero` feature.Markus Reiter-1/+0
2024-01-27Switch `NonZero` alias direction.Markus Reiter-0/+1
2024-01-23Auto merge of #119892 - joboet:libs_use_assert_unchecked, r=Nilstrieb,cuviperbors-0/+1
Use `assert_unchecked` instead of `assume` intrinsic in the standard library Now that a public wrapper for the `assume` intrinsic exists, we can use it in the standard library. CC #119131
2024-01-20Rollup merge of #120150 - Jules-Bertholet:stabilize-round-ties-even, r=cuviperMatthias Krüger-1/+0
Stabilize `round_ties_even` Closes #96710 `@rustbot` label -T-libs T-libs-api
2024-01-19Stabilize `round_ties_even`Jules Bertholet-1/+0
2024-01-19Stabilize simple offset_ofGeorge Bateman-1/+0
2024-01-13libs: use `assert_unchecked` instead of intrinsicjoboet-0/+1
2024-01-06Rollup merge of #118781 - RalfJung:core-panic-feature, r=the8472Matthias Krüger-1/+0
merge core_panic feature into panic_internals I don't know why those are two separate features, but it does not seem intentional. This merge is useful because with https://github.com/rust-lang/rust/pull/118123, panic_internals is recognized as an internal feature, but core_panic is not -- but core_panic definitely should be internal.
2023-12-26Rollup merge of #119235 - Urgau:missing-feature-gate-sanitizer-cfi-cfgs, ↵Michael Goulet-0/+1
r=Nilstrieb Add missing feature gate for sanitizer CFI cfgs Found during the review of https://github.com/rust-lang/rust/pull/118494 in https://github.com/rust-lang/rust/pull/118494#discussion_r1416079288. cc `@rcvalle`
2023-12-24Stabilize ip_in_core featureLinus Färnstrand-1/+0
2023-12-23Adjust the std library for sanitizer_cfi cfgs changesUrgau-0/+1