about summary refs log tree commit diff
path: root/library/std/src/sys
AgeCommit message (Collapse)AuthorLines
2025-09-13Rollup merge of #146473 - RalfJung:system-time-deconst, r=workingjubileeJacob Pratt-157/+66
Revert "Constify SystemTime methods" This reverts https://github.com/rust-lang/rust/pull/144519. The const-hacks introduces bugs, and they make the code harder to maintain. Let's wait until we can constify these functions without changing their implementation. Fixes https://github.com/rust-lang/rust/issues/146228. Closes https://github.com/rust-lang/rust/issues/144517 (since the feature is gone). r? `@tgross35` Cc `@clarfonthey`
2025-09-13also apply revert to wasip2Ralf Jung-18/+7
2025-09-12Revert "Constify SystemTime methods"Ralf Jung-139/+59
This reverts commit 7ce620dd7c6fc3371290b40a1ea28146f0d37031. The const-hacks introduces bugs, and they make the code harder to maintain. Let's wait until we can constify these functions without changing their implementation.
2025-09-12Auto merge of #146468 - Zalathar:rollup-6u3s44d, r=Zalatharbors-3/+6
Rollup of 15 pull requests Successful merges: - rust-lang/rust#144549 (match clang's `va_arg` assembly on arm targets) - rust-lang/rust#145895 (thread parking: fix docs and examples) - rust-lang/rust#146308 (support integer literals in `${concat()}`) - rust-lang/rust#146323 (check before test for hardware capabilites in bits 32~63 of usize) - rust-lang/rust#146332 (tidy: make behavior of extra-checks more uniform) - rust-lang/rust#146374 (Update `browser-ui-test` version to `0.22.2`) - rust-lang/rust#146413 (Improve suggestion in case a bare URL is surrounded by brackets) - rust-lang/rust#146426 (Bump miow to 0.60.1) - rust-lang/rust#146432 (Implement `Socket::take_error` for Hermit) - rust-lang/rust#146433 (rwlock tests: fix miri macos test regression) - rust-lang/rust#146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - rust-lang/rust#146439 (fix cfg for poison test macro) - rust-lang/rust#146448 ([rustdoc] Correctly handle literal search on paths) - rust-lang/rust#146449 (Fix `libgccjit` symlink when we build GCC locally) - rust-lang/rust#146455 (test: remove an outdated normalization for rustc versions) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-12Rollup merge of #146432 - hermit-os:hermit-take_error, r=joboetStuart Cook-2/+3
Implement `Socket::take_error` for Hermit This PR fixes an unused-imports compilation error introduced in 845311a065a5638c516ed96c73b09862b176b329 and implements `Socket::take_error` for Hermit. Hermit's `Socket::take_error` implementation works exactly like the one for Unix. r? joboet
2025-09-12Rollup merge of #145895 - RalfJung:unpark, r=joboetStuart Cook-1/+3
thread parking: fix docs and examples Fixes https://github.com/rust-lang/rust/issues/145816 r? ```@joboet``` Cc ```@m-ou-se``` ```@Amanieu```
2025-09-12Auto merge of #146019 - joboet:better-dlsym, r=tgross35bors-51/+111
std: optimize `dlsym!` macro and add a test for it The `dlsym!` macro always ensures that the name string is nul-terminated, so there is no need to perform the check at runtime. Also, acquire loads are generally faster than a load and a barrier, so use them. This is only false in the case where the symbol is missing, but that shouldn't matter too much.
2025-09-11Auto merge of #145177 - joboet:move-pal-thread, r=ibraheemdevbors-1093/+893
std: move `thread` into `sys` Part of https://github.com/rust-lang/rust/issues/117276.
2025-09-11Implement `Socket::take_error` for HermitMartin Kröning-1/+2
2025-09-11Remove unused import from sys/pal/hermit/os.rsMartin Kröning-1/+1
This fixes ``` error: unused import: `str` --> library/std/src/sys/pal/hermit/os.rs:6:22 | 6 | use crate::{fmt, io, str}; | ^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]` ``` This was caused by 845311a065a5638c516ed96c73b09862b176b329.
2025-09-11Rollup merge of #146379 - madsmtm:fix-platform_version-test, r=tgross35Stuart Cook-3/+3
Fix `compare_against_sw_vers` test The `saturating_sub` doesn't actually perform its intended since the version numbers are signed integers (which I changed in a later revision of https://github.com/rust-lang/rust/pull/138944). Fixes the issue described in https://github.com/rust-lang/rust/pull/138944#issuecomment-3270662876. r? tgross35
2025-09-10Rollup merge of #145327 - joboet:net-addr-sgx-hack, r=tgross35Matthias Krüger-190/+267
std: make address resolution weirdness local to SGX Currently, the implementations of `TcpStream::connect` and its cousins take an `io::Result<&SocketAddr>` as argument, which is very weird, as most of them then `?`-try the result immediately to access the actual address. This weirdness is however necessitated by a peculiarity of the SGX networking implementation: SGX doesn't support DNS resolution but rather accepts hostnames in the same place as socket addresses. So, to make e.g. ```rust TcpStream::connect("example.com:80")` ``` work, the DNS lookup returns a special error (`NonIpSockAddr`) instead, which contains the hostname being looked up. When `.to_socket_addrs()` fails, the `each_addr` function used to select an address will pass the error to the inner `TcpStream::connect` implementation, which in SGX's case will inspect the error and try recover the hostname from it. If that succeeds, it continues with the found hostname. This is pretty obviously a terrible hack and leads to buggy code (for instance, when users use the result of `.to_socket_addrs()` in their own `ToSocketAddrs` implementation to select from a list of possible URLs, the only URL used will be that of the last item tried). Still, without changes to the SGX usercall ABI, it cannot be avoided. Therefore, this PR aims to minimise the impact of that weirdness and remove it from all non-SGX platforms. The inner `TcpStream::connect`, et al. functions now receive the `ToSocketAddrs` type directly and call `each_addr` (which is moved to `sys::net::connection`) themselves. On SGX, the implementation uses a special `each_addr` which contains the whole pass-hostname-through-error hack. As well as making the code cleaner, this also opens up the possibility of reusing newly created sockets even if a connection request fails – but I've left that for another PR. CC `@raoulstrackx`
2025-09-10std: only test `dlsym!` on platforms where it is actually usedjoboet-0/+10
`dlsym` doesn't work for finding libc symbols on platforms like linux-musl, so the test will fail.
2025-09-10std: move `thread` into `sys`joboet-1038/+838
2025-09-09Fix compare_against_sw_vers test when a version part is 0Mads Marquart-3/+3
2025-09-08Weakly export platform_version symbolsMads Marquart-0/+5
The symbols __isPlatformVersionAtLeast and __isOSVersionAtLeast. This allows the user to link both compiler_rt and std.
2025-09-08Reorder test to make failures clearerMads Marquart-3/+3
2025-09-08std: move `thread` into `sys` (rename only)joboet-0/+0
2025-09-08std: make address resolution weirdness local to SGXjoboet-190/+267
2025-09-07Rollup merge of #146269 - weihanglo:solaris-flock, r=Mark-SimulacrumMatthias Krüger-0/+66
feat(std): emulate flock for solaris via fcntl Upstream Solaris flock emulation to libstd from cargo. This is borrowed from https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee. The code has been in cargo since 2022-12. Python's `fcntl.flock` emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400 We did the same thing in https://github.com/rust-lang/rust/blob/0d0f4eac8b98133e5da6d3604d86a8f3b5a67844/compiler/rustc_data_structures/src/flock/unix.rs#L13-L39 However, should we just always falls back to fcntl for all Unix, instead of "unsupported"? try-job: `*-solaris`
2025-09-07feat(std): emulate flock for solaris via fcntlWeihang Lo-0/+66
Upstream Solaris flock emulation to libstd from cargo. This is borrowed from https://github.com/rust-lang/cargo/blob/3b379fcc541b39321a7758552d37e5e0cc4277b9/src/cargo/util/flock.rs#L502-L536 which was implemented by an Oracle employee. The code has been in cargo since 2022-12. Python's `fcntl.flock` emulates like this as well: https://github.com/python/cpython/blob/c919d02edecfe9d75fe374756fb8aa1db8d95f55/Modules/fcntlmodule.c#L337-L400 We did the same thing in https://github.com/rust-lang/rust/blob/0d0f4eac8b98133e5da6d3604d86a8f3b5a67844/compiler/rustc_data_structures/src/flock/unix.rs#L13-L39
2025-09-06Rollup merge of #139524 - Berrysoft:cygwin-socket-ext, r=tgross35Trevor Gross-6/+6
Add socket extensions for cygwin r? `@joboet` * Abstract name uds addr * quickack * passcred
2025-09-06Add socket extensions for cygwinBerrysoft-6/+6
2025-09-05Rollup merge of #138944 - madsmtm:apple_os_version_check, r=tgross35León Orell Valerian Liehr-0/+1075
Add `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast` symbols ## Motivation When Objective-C code uses ```@available(...)`,`` Clang inserts a call to [`__isPlatformVersionAtLeast`](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/compiler-rt/lib/builtins/os_version_check.c#L276) (`__isOSVersionAtLeast` in older Clang versions). These symbols not being available sometimes ends up causing linker errors. See the new test `tests/run-make/apple-c-available-links` for a minimal reproducer. The workaround is to link `libclang_rt.osx.a`, see e.g. https://github.com/alexcrichton/curl-rust/issues/279. But that's very difficult for users to figure out (and the backreferences to that issue indicates that people are still running into this in their own projects every so often). For another recent example, this is preventing `rustc` from using LLVM assertions on macOS, see https://github.com/rust-lang/rust/pull/62592#issuecomment-510670657 and https://github.com/rust-lang/rust/pull/134275#issuecomment-2543067830. It is also a blocker for [setting the correct minimum OS version in `cc-rs`](https://github.com/rust-lang/rust/issues/136113), since fixing this in `cc-rs` might end up introducing linker errors in places where we weren't before (by default, if using e.g. ```@available(macos`` 10.15, *)`, the symbol usually happens to be left out, since `clang` defaults to compiling for the host macOS version, and thus things _seem_ to work - but the availability check actually compiles down to nothing, which is a huge correctness footgun for running on older OSes). (My super secret evil agenda is also to expose some variant of ```@available``` in Rust's `std` after https://github.com/rust-lang/rfcs/pull/3750 progresses further, will probably file an ACP for this later. But I believe this PR has value regardless of those future plans, since we'd be making C/Objective-C/Swift interop easier). ## Solution Implement `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast` as part of the "public ABI" that `std` exposes. **This is insta-stable**, in the same sense that additions to `compiler-builtins` are insta-stable, though the availability of these symbols can probably be considered a "quality of implementation" detail rather than a stable promise. I originally proposed to implement this in `compiler-builtins`, see https://github.com/rust-lang/compiler-builtins/pull/794, but we discussed moving it to `std` instead ([Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Provide.20.60__isPlatformVersionAtLeast.60.20in.20.60std.60.3F/with/507880717)), which makes the implementation substantially simpler, and we avoid gnarly issues with requiring the user to link `libSystem.dylib` (since `std` unconditionally does that). Note that this does not solve the linker errors for (pure) `#![no_std]` users, but that's _probably_ fine, if you are using ```@available``` to test the OS version on Apple platforms, you're likely also using `std` (and it is still possible to work around by linking `libclang_rt.*.a`). A thing to note about the implementation, I've choosen to stray a bit from LLVM's upstream implementation, and not use `_availability_version_check` since [it has problems when compiling with an older SDK](https://github.com/llvm/llvm-project/issues/64227). Instead, we use `sysctl kern.osproductversion` when available to still avoid the costly PList lookup in most cases, but still with a fall back to the PList lookup when that is not available (with the PList fallback being is similar to LLVM's implementation). ## Testing Apple has a lot of different "modes" that they can run binaries in, which can be a bit difficult to find your bearings in, but I've tried to be as thorough as I could in testing them all. Tested using roughly the equivalent of `./x test library/std -- platform_version` on the following configurations: - macOS 14.7.3 on a Macbook Pro M2 - `aarch64-apple-darwin` - `x86_64-apple-darwin` (under Rosetta) - `aarch64-apple-ios-macabi` - `x86_64-apple-ios-macabi` (under Rosetta) - `aarch64-apple-ios` (using Xcode's "Designed for iPad" setting) - `aarch64-apple-ios-sim` (in iOS Simulator, as iPhone with iOS 17.5) - `aarch64-apple-ios-sim` (in iOS Simulator, as iPad with iOS 18.2) - `aarch64-apple-tvos-sim` (in tvOS Simulator) - `aarch64-apple-watchos-sim` (in watchOS Simulator) - `aarch64-apple-ios-sim` (in visionOS simulator, using Xcode's "Designed for iPad" setting) - `aarch64-apple-visionos-sim` (in visionOS Simulator) - macOS 15.3.1 VM - `aarch64-apple-darwin` - `aarch64-apple-ios-macabi` - macOS 10.12.6 on an Intel Macbook from 2013 - `x86_64-apple-darwin` - `i686-apple-darwin` - `x86_64-apple-ios` (in iOS Simulator) - iOS 9.3.6 on a 1st generation iPad Mini - `armv7-apple-ios` with an older compiler Along with manually inspecting the output of `version_from_sysctl()` and `version_from_plist()`, and verifying that they actually match what's expected. I believe the only real omissions here would be: - `aarch64-apple-ios` on a newer iPhone that has `sysctl` available (iOS 11.4 or above). - `aarch64-apple-ios` on a Vision Pro using Xcode's "Designed for iPad" setting. But I don't have the hardware available to test those. ``@rustbot`` label O-apple A-linkage -T-compiler -A-meta -A-run-make try-job: aarch64-apple
2025-09-05Add __isOSVersionAtLeast and __isPlatformVersionAtLeast symbolsMads Marquart-0/+1075
Allows users to link to Objective-C code using `@available(...)`.
2025-09-05Rollup merge of #146207 - alexcrichton:wasip2-stdio, r=juntyrTrevor Gross-3/+127
std: Implement WASIp2-specific stdio routines This commit is an extension of rust-lang/rust#145944 but applied to stdio specifically. The stdio routines are updated away from WASIp1 APIs to using WASIp2 APIs natively. The end goal is to eventually drop the dependency on WASIp1 APIs in the standard library entirely in favor of exclusively depending on WASIp2.
2025-09-04std: Implement WASIp2-specific stdio routinesAlex Crichton-3/+127
This commit is an extension of previous libstd support but applied to stdio specifically. The stdio routines are updated away from WASIp1 APIs to using WASIp2 APIs natively. The end goal is to eventually drop the dependency on WASIp1 APIs in the standard library entirely in favor of exclusively depending on WASIp2.
2025-09-04Rollup merge of #140459 - niklasf:feature/read-buf-at, r=tgross35Stuart Cook-23/+63
Add `read_buf` equivalents for positioned reads Adds the following items under the ~~`read_buf` (rust-lang/rust#78485)~~ `read_buf_at` (rust-lang/rust#140771) feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf` try-job: `x86_64-msvc*` try-job: `test-various*` try-job: `dist-various*`
2025-09-03Add `read_buf` equivalents for positioned readsNiklas Fiekas-23/+63
Adds the following items under the `read_buf_at` feature: - `std::os::unix::fs::FileExt::read_buf_at` - `std::os::unix::fs::FileExt::read_buf_exact_at` - `std::os::windows::fs::FileExt::seek_read_buf`
2025-09-03std: improve the `dlsym!` macro and add a test for itjoboet-51/+101
* Ensure nul-termination of the symbol name at compile-time * Use an acquire load instead of a relaxed load and acquire fence * Properly use `unsafe` and add safety comments * Add tests
2025-09-03Rollup merge of #145944 - alexcrichton:native-wasip2, r=tgross35Stuart Cook-13/+177
std: Start supporting WASIp2 natively This commit is the start of an effort to support WASIp2 natively in the standard library. Before this commit the `wasm32-wasip2` target behaved exactly like `wasm32-wasip1` target by importing APIs from the core wasm module `wasi_snapshot_preview1`. These APIs are satisfied by the `wasm-component-ld` target by using an [adapter] which implements WASIp1 in terms of WASIp2. This adapter comes at a cost, however, in terms of runtime indirection and instantiation cost, so ideally the adapter would be removed entirely. The purpose of this adapter was to provide a smoother on-ramp from WASIp1 to WASIp2 when it was originally created. The `wasm32-wasip2` target has been around for long enough now that it's much more established. Additionally the only thing historically blocking using WASIp2 directly was implementation effort. Work is now underway to migrate wasi-libc itself to using WASIp2 directly and now seems as good a time as any to migrate the Rust standard library too. Implementation-wise the milestones here are: * The `wasm32-wasip2` target now also depends on the `wasi` crate at version 0.14.* in addition to the preexisting dependency of 0.11.*. The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs. * Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to `wasip1` where appropriate. For example `std::sys::pal::wasi` is now called `std::sys::pal::wasip1`. * More platform-specific WASI modules are now split between WASIp1 and WASIp2. For example getting the current time, randomness, and process arguments now use WASIp2 APIs directly instead of using WASIp1 APIs that require an adapter. It's worth pointing out that this PR does not migrate the entire standard library away from using WASIp1 APIs on the `wasm32-wasip2` target. Everything related to file descriptors and filesystem APIs is still using WASIp1. Migrating that is left for a future PR. In the meantime the goal of this change is to lay the groundwork necessary for migrating in the future. Eventually the goal is to drop the `wasi` 0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1` target will continue to retain this dependency). [adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
2025-09-03thread parking: fix docs and examplesRalf Jung-1/+3
2025-09-02improve process::abort rendering in Miri backtracesRalf Jung-0/+2
2025-08-31std: fix `SplitPaths` regressionjoboet-5/+15
2025-08-30Rollup merge of #146030 - ChrisDenton:wait-timeout, r=tgross35Trevor Gross-6/+18
Fix `sys::process::windows::tests::test_thread_handle` spurious failure Instead of sleeping, wait for the process to finish so that we can be sure it's done. We use a timeout because otherwise this test can be stuck indefinitely if it fails (unfortunately std doesn't currently have a way to wait with a timeout so a manual OS API call is necessary). I also changed the test to run `whoami` and pipe the output to null so that it doesn't clutter up the test output. Fixes rust-lang/rust#146024
2025-08-30Fix spurious test timeoutChris Denton-6/+18
2025-08-30std: clarify `OpenOptions` error for create without write accessVladimir Petrzhikovskii-6/+44
Previously, attempting to create/truncate a file without write/append access would result in platform-specific error messages: - Unix: "Invalid argument" - Windows: raw OS error code 87 These error codes look like system errors, which could waste hours of debugging for what is actually an API misuse issue.
2025-08-29Rollup merge of #146017 - maurer:pipe2, r=Mark-SimulacrumTrevor Gross-0/+1
Mark pipe2 supported in Android Android has supported pipe2 since 2010, long before the current min SDK.
2025-08-29Rollup merge of #145991 - GrigorenkoPV:haiku, r=tgross35Trevor Gross-1/+1
std: haiku: fix `B_FIND_PATH_IMAGE_PATH` Fixes https://github.com/rust-lang/rust/issues/145952, which was caused by https://github.com/rust-lang/libc/pull/4575 ```````@rustbot``````` label T-libs O-haiku
2025-08-29std: use a TAIT to define `SplitPaths` on UNIXjoboet-29/+7
2025-08-29std: haiku: fix `B_FIND_PATH_IMAGE_PATH`Pavel Grigorenko-1/+1
2025-08-29Rollup merge of #145793 - he32:netbsd-libexecinfo-fix, r=Mark-SimulacrumStuart Cook-0/+1
std library: use execinfo library also on NetBSD. The execinfo library is also available on NetBSD.
2025-08-29Rollup merge of #144354 - rafaeling:fix-142726-qnx8-link-fail, r=tgross35Stuart Cook-1/+1
fix(std): Fix undefined reference to __my_thread_exit on QNX 8.0 When cross-compiling for the x86_64/aarch64-unknown-nto-qnx800 target (QNX SDP 8.0), the build fails during the final link stage with the error: ``` error: linking with `qcc` failed: exit status: 1 ... = note: undefined reference to `__my_thread_exit' ``` - **On QNX 7.1**: The __my_thread_exit symbol is defined and exported by the main C library (libc.a/libc.so). The std backtrace code can therefore successfully take its address at compile time. - **On QNX 8.0**: As part of a toolchain modernization, this symbol has been refactored. It is no longer present in any of the standard system libraries (.a or .so). This patch addresses the problem at its source by conditionally compiling the problematic code. Fixes rust-lang/rust#142726
2025-08-29Mark pipe2 supported in AndroidMatthew Maurer-0/+1
Android has supported pipe2 since 2010, long before the current min SDK.
2025-08-28std: Start supporting WASIp2 nativelyAlex Crichton-13/+177
This commit is the start of an effort to support WASIp2 natively in the standard library. Before this commit the `wasm32-wasip2` target behaved exactly like `wasm32-wasip1` target by importing APIs from the core wasm module `wasi_snapshot_preview1`. These APIs are satisfied by the `wasm-component-ld` target by using an [adapter] which implements WASIp1 in terms of WASIp2. This adapter comes at a cost, however, in terms of runtime indirection and instantiation cost, so ideally the adapter would be removed entirely. The purpose of this adapter was to provide a smoother on-ramp from WASIp1 to WASIp2 when it was originally created. The `wasm32-wasip2` target has been around for long enough now that it's much more established. Additionally the only thing historically blocking using WASIp2 directly was implementation effort. Work is now underway to migrate wasi-libc itself to using WASIp2 directly and now seems as good a time as any to migrate the Rust standard library too. Implementation-wise the milestones here are: * The `wasm32-wasip2` target now also depends on the `wasi` crate at version 0.14.* in addition to the preexisting dependency of 0.11.*. The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs. * Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to `wasip1` where appropriate. For example `std::sys::pal::wasi` is now called `std::sys::pal::wasip1`. * More platform-specific WASI modules are now split between WASIp1 and WASIp2. For example getting the current time, randomness, and process arguments now use WASIp2 APIs directly instead of using WASIp1 APIs that require an adapter. It's worth pointing out that this PR does not migrate the entire standard library away from using WASIp1 APIs on the `wasm32-wasip2` target. Everything related to file descriptors and filesystem APIs is still using WASIp1. Migrating that is left for a future PR. In the meantime the goal of this change is to lay the groundwork necessary for migrating in the future. Eventually the goal is to drop the `wasi` 0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1` target will continue to retain this dependency). [adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
2025-08-28Rollup merge of #142727 - hkBst:rm-static-mut-wasm, r=ChrisDentonStuart Cook-7/+10
wasm: rm static mut More https://github.com/rust-lang/rust/issues/125035. I'm not sure this is correct, but it compiles.
2025-08-27Rollup merge of #145746 - ivmarkov:fix-nofollow-espidf, r=ibraheemdevJacob Pratt-2/+11
Fix STD build failing for target_os = "espidf" A regression from rust-lang/rust#142938 cc `@lolbinarycat` cc `@ibraheemdev` ESP-IDF (and a few other embedded Tier-3 systems) is considered `cfg(unix)`, but it does not have the `O_NOFOLLOW` flag because neither of its three supported filesystems (FATFS, LitteLF and Spiffs) has symbolic links in the first place. What this fix does is to keep the `set_permissions_nofollow` method available and non-failing for ESP-IDF, but it behaves as if no `O_NONFOLLOW` was set. This should be fine as there is nothing to follow in the first place, as there are no symbolic links there. EDIT: Also added the same fix for Horizon, as requested by `@Meziu.`
2025-08-27Rollup merge of #145335 - clarfonthey:wtf8-core-alloc, r=Mark-SimulacrumMatthias Krüger-3/+5
Move WTF-8 code from std into core and alloc This is basically a small portion of rust-lang/rust#129411 with a smaller scope. It *does not*\* affect any public APIs; this code is still internal to the standard library. It just moves the WTF-8 code into `core` and `alloc` so it can be accessed by `no_std` crates like `backtrace`. > \* The only public API this affects is by adding a `Debug` implementation to `std::os::windows::ffi::EncodeWide`, which was not present before. This is due to the fact that `core` requires `Debug` implementations for all types, but `std` does not (yet) require this. Even though this was ultimately changed to be a wrapper over the original type, not a re-export, I decided to keep the `Debug` implementation so it remains useful. Like we do with ordinary strings, the tests are still located entirely in `alloc`, rather than splitting them into `core` and `alloc`. ---- Reviewer note: for ease of review, this is split into three commits: 1. Moving the original files into their new "locations" 2. Actually modifying the code to compile. 3. Removing aesthetic changes that were made so that the diff for commit 2 was readable. You can review commits 1 and 3 to verify these claims, but commit 2 contains the majority of the changes you should care about. ---- API changes: `impl Debug for std::os::windows::ffi::EncodeWide`
2025-08-26Rollup merge of #144373 - hkBst:remove-deprecated-1, r=jhprattGuillaume Gomez-81/+14
remove deprecated Error::description in impls [libs-api permission](https://github.com/rust-lang/libs-team/issues/615#issuecomment-3074045829) r? `@cuviper` or `@jhpratt`
2025-08-26remove deprecated Error::description in implsMarijn Schouten-81/+14