about summary refs log tree commit diff
path: root/library/std/src
AgeCommit message (Collapse)AuthorLines
2022-08-16Refactor copying data to userspaceRaoul Strackx-19/+32
2022-08-15Auto merge of #100007 - ChrisDenton:dtor-inline-never, r=michaelwoeristerbors-0/+4
Never inline Windows dtor access Inlining can cause problem If used in a Rust dylib. See #44391. r? `@Mark-Simulacrum`
2022-08-15Optimize poison guards to ZSTs when panic=abortTyler Mandry-2/+49
2022-08-15Semicolon after macro_rules definition.Orson Peters-2/+2
2022-08-15Float biteq macros can be unused if test is skipped.Orson Peters-0/+2
2022-08-15Skip next_up/down tests entirely on x87.Orson Peters-112/+114
2022-08-15Conditionally do not compile NaN roundtrip tests on x87 fp.Orson Peters-44/+44
2022-08-15Ensure NaN references values go through function boundary for next_up/down.Orson Peters-12/+36
2022-08-15Fixed float next_up/down 32-bit x87 float NaN roundtrip test case.Orson Peters-24/+24
2022-08-15Added next_up and next_down for f32/f64.Orson Peters-0/+127
2022-08-14Rollup merge of #100249 - Meziu:master, r=joshtriplettMatthias Krüger-5/+5
Fix HorizonOS regression in FileTimes The changes in #98246 caused a regression for multiple Newlib-based systems. This is just a fix including HorizonOS to the list of targets which require a workaround. ``@AzureMarker`` ``@ian-h-chamberlain`` r? ``@nagisa``
2022-08-14Add mention of `BufReader` in `Read::bytes` docsJakub Dąbek-1/+6
2022-08-13Rollup merge of #100407 - RalfJung:no-int2ptr, r=Mark-SimulacrumMichael Goulet-4/+5
avoid some int2ptr casts in thread_local_key tests
2022-08-13created tcpstream quickack traitBerend-Jan Lange-2/+138
for linux and android
2022-08-12Apply changes from rustfmt bumpMark Rousskov-1/+1
2022-08-12Adjust cfgsMark Rousskov-12/+10
2022-08-12Rollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcmDylan DPC-4/+5
cleanup code w/ pointers in std a little Use pointer methods (`byte_add`, `null_mut`, etc) to make code in std a little nicer.
2022-08-12Rollup merge of #100022 - joboet:faster_threadid, r=joshtriplettDylan DPC-18/+41
Optimize thread ID generation By using atomics where available, thread IDs can be generated without locking while still enforcing uniqueness.
2022-08-12Auto merge of #99624 - vincenzopalazzo:macros/unix_error, r=Amanieubors-2/+6
promote debug_assert to assert when possible and useful This PR fixed a very old issue https://github.com/rust-lang/rust/issues/94705 to clarify and improve the POSIX error checking, and some of the checks are skipped because can have no benefit, but I'm sure that this can open some interesting discussion. Fixes https://github.com/rust-lang/rust/issues/94705 cc: `@tavianator` cc: `@cuviper`
2022-08-11Rollup merge of #100418 - tbodt:stabilize-backtrace, r=dtolnayMatthias Krüger-0/+3
Add stability attributes to BacktraceStatus variants Fixes #100399
2022-08-11Rollup merge of #100203 - compiler-errors:command-args-size-hint, r=m-ou-seMatthias Krüger-0/+3
provide correct size hint for unsupported platform `CommandArgs` Split from https://github.com/rust-lang/rust/pull/99880#discussion_r932994172
2022-08-11Rollup merge of #99421 - Bryanskiy:android-crt-static, r=petrochenkovMatthias Krüger-2/+5
add crt-static for android
2022-08-11Add stability attributes to BacktraceStatus variantsTheodore Dubois-0/+3
Fixes #100399
2022-08-11Rollup merge of #100287 - cuviper:no-linux-prctl, r=Mark-SimulacrumDylan DPC-3/+9
linux: Use `pthread_setname_np` instead of `prctl` This function is available on Linux since glibc 2.12, musl 1.1.16, and uClibc 1.0.20. The main advantage over `prctl` is that it properly represents the pointer argument, rather than a multi-purpose `long`, so we're better representing strict provenance (#95496).
2022-08-11avoid some int2ptr casts in thread_local_key testsRalf Jung-4/+5
2022-08-11Auto merge of #100298 - BlackHoleFox:hashmap_keygen_cleanup, r=Mark-Simulacrumbors-9/+9
Replace pointer casting in hashmap_random_keys with safe code The old code was unnecessarily unsafe and relied on the layout of tuples always being the same as an array of the same size (which might be bad with `-Z randomize-layout`)? The replacement has [identical codegen](https://rust.godbolt.org/z/qxsvdb8nx), so it seems like a reasonable change.
2022-08-11promote debug_assert to assertVincenzo Palazzo-2/+6
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-10add crt-static for androidBryanskiy-2/+5
2022-08-10std: optimize thread ID generationjoboet-18/+41
2022-08-10Rollup merge of #99573 - tbodt:stabilize-backtrace, r=yaahcMatthias Krüger-8/+11
Stabilize backtrace This PR stabilizes the std::backtrace module. As of #99431, the std::Error::backtrace item has been removed, and so the rest of the backtrace feature is set to be stabilized. Previous discussion can be found in #72981, #3156. Stabilized API summary: ```rust pub mod std { pub mod backtrace { pub struct Backtrace { } pub enum BacktraceStatus { Unsupported, Disabled, Captured, } impl fmt::Debug for Backtrace {} impl Backtrace { pub fn capture() -> Backtrace; pub fn force_capture() -> Backtrace; pub const fn disabled() -> Backtrace; pub fn status(&self) -> BacktraceStatus; } impl fmt::Display for Backtrace {} } } ``` `@yaahc`
2022-08-09Apply suggestions from code reviewJane Losare-Lusby-10/+10
2022-08-10Guarantee `try_reserve` preserves the contents on errorYOSHIOKA Takuma-2/+4
Update doc comments to make the guarantee explicit. However, some implementations does not have the statement though. * `HashMap`, `HashSet`: require guarantees on hashbrown side. * `PathBuf`: simply redirecting to `OsString`. Fixes #99606.
2022-08-08Replace pointer casting in hashmap_random_keys with safe codeBlackHoleFox-9/+9
The old code was unnecessarily unsafe and relied on the layout of tuples always being the same as an array of the same size.
2022-08-08Add standard C error function aliasesBlackHoleFox-0/+2
Aids the discoverability of `io::Error::last_os_error()` by linking to commonly used error number functions from C/C++.
2022-08-08linux: Use `pthread_setname_np` instead of `prctl`Josh Stone-3/+9
This function is available on Linux since glibc 2.12, musl 1.1.16, and uClibc 1.0.20. The main advantage over `prctl` is that it properly represents the pointer argument, rather than a multi-purpose `long`, so we're better representing strict provenance (#95496).
2022-08-07Fix HorizonOS regression in FileTimesAndrea Ciliberti-5/+5
2022-08-07Rollup merge of #100127 - ChrisDenton:remove-init, r=thomccMatthias Krüger-160/+94
Remove Windows function preloading After `@Mark-Simulacrum` asked me to provide guidance for when optionally imported functions should be preloaded, I realised my justifications were now quite weak. I think the strongest argument that can be made is that it avoids some degree of nondeterminism when calling these functions (in as far as system API calls can be said to be deterministic). However, I don't think that's particularly convincing unless there's a real world use case where it matters. Further discussion with `@thomcc` has strengthened my feeling that preloading isn't really needed. Note that `WaitOnAddress` needed some adjustment to work without preloading. I opted not to use a macro for this special case as it seemed silly to do so for just one thing (and I don't like macros tbh).
2022-08-06provide correct size hint for unsupported platform CommandArgsMichael Goulet-0/+3
2022-08-05non-linux platformsNick Cameron-140/+205
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-08-05cleanup code w/ pointers in std a littleMaybe Waffle-4/+5
2022-08-04Add some docs for BorrowBufNick Cameron-24/+60
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-08-04std::io: migrate ReadBuf to BorrowBuf/BorrowCursorNick Cameron-390/+324
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-08-04Update after code reviewChris Denton-6/+12
2022-08-04kmc-solid: Add a stub implementation of `File::set_times`Tomoaki Kawada-0/+12
2022-08-04Remove Windows function preloadingChris Denton-158/+86
2022-08-04Add visibility modifier to compat macroChris Denton-2/+2
2022-08-03FilesTimes support does not build for ESP-IDFIvan Markov-3/+7
2022-08-03Rollup merge of #99800 - sandydoo:bugfix/wasm-futex, r=m-ou-seDylan DPC-2/+4
Fix futex module imports on wasm+atomics The futex modules were rearranged a bit in #98707, which meant that wasm+atomics would no longer compile on nightly. I don’t believe any other targets were impacted by this.
2022-08-03Rollup merge of #99371 - ChrisDenton:simplify-gen-random-keys, r=thomccDylan DPC-60/+8
Remove synchronization from Windows `hashmap_random_keys` Unfortunately using synchronization when generating hashmap keys can prevent it being used in `DllMain`. ~~Fixes #99341~~
2022-08-02Stabilize backtraceTheodore Dubois-8/+11