| Age | Commit message (Collapse) | Author | Lines |
|
float types: document NaN bit pattern guarantees
Part of https://github.com/rust-lang/rust/issues/128288: document the guarantees we make for NaN bit patterns.
Cc ``@tgross35``
|
|
pal/hermit: correctly round up microseconds in `Thread::sleep`
This fixes the Hermit-related part of https://github.com/rust-lang/rust/issues/129212 and thus the whole issue, since ESP-IDF is already fixed, as far as I understand.
Fixes https://github.com/rust-lang/rust/issues/129212
r? `@workingjubilee`
CC: `@stlankes`
|
|
|
|
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
|
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
|
program
|
|
r=dtolnay
library: Move unstable API of new_uninit to new features
- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`
The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
|
|
Rollup of 9 pull requests
Successful merges:
- #128596 (stabilize const_fn_floating_point_arithmetic)
- #129199 (make writes_through_immutable_pointer a hard error)
- #129246 (Retroactively feature gate `ConstArgKind::Path`)
- #129290 (Pin `cc` to 1.0.105)
- #129323 (Implement `ptr::fn_addr_eq`)
- #129500 (remove invalid `TyCompat` relation for effects)
- #129501 (panicking: improve hint for Miri's RUST_BACKTRACE behavior)
- #129505 (interpret: ImmTy: tighten sanity checks in offset logic)
- #129510 (Fix `elided_named_lifetimes` in code)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Update `compiler_builtins` to `0.1.121`
To pick up https://github.com/rust-lang/compiler-builtins/pull/673 and unblock https://github.com/rust-lang/rust/pull/129403
r? tgross35
|
|
panicking: improve hint for Miri's RUST_BACKTRACE behavior
Should help with https://github.com/rust-lang/miri/issues/3838
|
|
|
|
- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`
The remainder will be stabilized in upcoming patches, as
it was decided to only stabilize `uninit*` and `assume_init`.
|
|
|
|
Since the `compiler_builtins` update [1], ABI bugs on x86 should be
resolved. Enable tests for f16 on these platforms now.
`f16` math functions (`reliable_f16_math`) are still excluded because
there is an LLVM crash for powi [2].
[1]: https://github.com/rust-lang/rust/pull/125016
[2]: https://github.com/llvm/llvm-project/issues/105747
|
|
Update `compiler_builtins` to `0.1.120`
Includes https://github.com/rust-lang/compiler-builtins/pull/672 which fixes regression issue with Apple and Windows compilers.
try-job: aarch64-apple
try-job: x86_64-apple-1
try-job: x86_64-msvc
|
|
fix: fs::remove_dir_all: treat internal ENOENT as success
fixes #127576
try-job: test-various
|
|
fixes #127576
windows implementation still needs some work
|
|
Linked to chown(2) manpage on the web which expands on chown call behaviour.
|
|
Include warning about losing setuid/gid when chowning, per POSIX.
|
|
Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
|
|
r=tgross35
WASI: forbid `unsafe_op_in_unsafe_fn` for `std::{os, sys}`
Part of https://github.com/rust-lang/rust/issues/127747 for WASI
try-job: test-various
|
|
|
|
|
|
Fix `thread::sleep` Duration-handling for ESP-IDF
Addresses the ESP-IDF specific aspect of https://github.com/rust-lang/rust/issues/129212
#### A short summary of the problems addressed by this PR:
================================================
1. **Problem 1** - the current implementation of `std::thread::sleep` does not properly round up the passed `Duration`
As per the documentation of `std::thread::sleep`, the implementation should sleep _at least_ for the provided duration, but not less. Since the minimum supported resolution of the `usleep` syscall which is used with ESP-IDF is one microsecond, this means that we need to round-up any sub-microsecond nanos to one microsecond. Moreover, in the edge case where the user had passed a duration of < 1000 nanos (i.e. less than one microsecond), the current implementation will _not_ sleep _at all_.
This is addressed by this PR.
2. **Problem 2** - the implementation of `usleep` on the ESP-IDF can overflow if the passed number of microseconds is >= `u32::MAX - 1_000_000`
This is also addressed by this PR.
Extra details for Problem 2:
`u32::MAX - 1_000_000` is chosen to accommodate for the longest possible systick on the ESP IDF which is 1000ms.
The systick duration is selected when compiling the ESP IDF FreeRTOS task scheduler itself, so we can't know it from within `STD`. The default systick duration is 10ms, and might be lowered down to 1ms. (Making it longer I have never seen, but in theory it can go up to a 1000ms max, even if obviously a one second systick is unrealistic - but we are paranoid in the PR.)
While the overflow is reported upstream in the ESP IDF repo[^1], I still believe we should workaround it in the Rust wrappers as well, because it might take time until it is fixed, and they might not fix it for all released ESP IDF versions.
For big durations, rather than calling `usleep` repeatedly on the ESP-IDF in chunks of `u32::MAX - 1_000_000`us, it might make sense to call instead with 1_000_000us (one second) as this is the max period that seems to be agreed upon as a safe max period in the `usleep` POSIX spec. On the other hand, that might introduce less precision (as we need to call more times `usleep` in a loop) and, we would be fighting a theoretical problem only, as I have big doubts the ESP IDF will stop supporting durations higher than 1_000_000us - ever - because of backwards compatibility with code which already calls `usleep` on the ESP IDF with bigger durations.
[^1]: https://github.com/espressif/esp-idf/issues/14390
|
|
These used to be `&str` literals that did need a pointer cast, but that
became a no-op after switching to `c""` literals in #118566.
|
|
doc: std::env::var: Returns None for names with '=' or NUL byte
The documentation incorrectly stated that std::env::var could return an error for variable names containing '=' or the NUL byte. Copy the correct documentation from var_os.
var_os was fixed in Commit 8a7a665, Pull Request #109894, which closed Issue #109893.
This documentation was incorrectly added in commit f2c0f292, which replaced a panic in var_os by returning None, but documented the change as "May error if ...".
Reference the specific error values and link to them.
|
|
|
|
|
|
CloneToUninit impls
As per #126799.
Also implements it for `Wtf8` and both versions of `os_str::Slice`.
Maybe it is worth to slap `#[inline]` on some of those impls.
r? `@dtolnay`
|
|
|
|
|
|
|
|
to stabilise the quickack part for now, tcp_deferaccept had been added at a
later stage.
|
|
This clarifies possible outputs the constants might be.
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #122884 (Optimize integer `pow` by removing the exit branch)
- #127857 (Allow to customize `// TODO:` comment for deprecated safe autofix)
- #129034 (Add `#[must_use]` attribute to `Coroutine` trait)
- #129049 (compiletest: Don't panic on unknown JSON-like output lines)
- #129050 (Emit a warning instead of an error if `--generate-link-to-definition` is used with other output formats than HTML)
- #129056 (Fix one usage of target triple in bootstrap)
- #129058 (Add mw back to review rotation)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add windows-targets crate to std's sysroot
With this PR, when backtrace is used as a crate from crates.io it will (once updated) use the real [windows-targets](https://crates.io/crates/windows-targets) crate. But when used from std it'll use std's replacement version.
This allows sharing our customized `windows_tagets::link!` macro between std proper and the backtrace crate when used as part of std, ensuring a consistent linking story. This will be especially important once we move to using [`raw-dylib`](https://doc.rust-lang.org/reference/items/external-blocks.html#dylib-versus-raw-dylib) by default.
|
|
This includes `std::os::darwin::fs`, which is re-exported under
`std::os::macos::fs` and `std::os::ios::fs`.
`std::os::darwin::raw` is not exposed, which means that
`MetadataExt::as_raw_stat` isn't available on tvOS, visionOS and
watchOS.
|
|
Allow to customize `// TODO:` comment for deprecated safe autofix
Relevant for the deprecation of `CommandExt::before_exit` in #125970.
Tracking:
- #124866
|
|
Rollup of 7 pull requests
Successful merges:
- #128643 (Refactor `powerpc64` call ABI handling)
- #128655 (std: refactor UNIX random data generation)
- #128745 (Remove unused lifetime parameter from spawn_unchecked)
- #128841 (bootstrap: don't use rustflags for `--rustc-args`)
- #128983 (Slightly refactor `TargetSelection` in bootstrap)
- #129026 (CFI: Move CFI ui tests to cfi directory)
- #129040 (Fix blessing of rmake tests)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove unused lifetime parameter from spawn_unchecked
Amanieu caught this when reviewing the stabilization proposal in https://github.com/rust-lang/rust/issues/55132.
The `'a` lifetime here is useless. The signature is asking the caller of `spawn_unchecked` to "give me any lifetime that is shorter than your F's and T's lifetime", which they can always to with no effect, because arbitrarily short lifetimes exist.
|
|
std: refactor UNIX random data generation
This PR makes a number of changes to the UNIX randomness implementation:
* Use `io::Error` for centralized error handling
* Move the file-fallback logic out of the `getrandom`-specific module
* Stop redefining the syscalls on macOS and DragonFly, they have appeared in `libc`
* Add a `OnceLock` to cache the random device file descriptor
|
|
This doesn't work for translated compiler error messages.
|
|
Relevant for the deprecation of `CommandExt::before_exit` in #125970.
|
|
|
|
|
|
std: do not overwrite style in `get_backtrace_style`
If another thread calls `set_backtrace_style` while a `get_backtrace_style` is reading the environment variables, `get_backtrace_style` will overwrite the value. Use an atomic CAS to avoid this.
|
|
|
|
If another thread calls `set_backtrace_style` while a `get_backtrace_style` is reading the environment variables, `get_backtrace_style` will overwrite the value. Use an atomic CAS to avoid this.
|