From 3b4b4cad156479fea864efa6e6cdf9a71cb91386 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Mon, 27 Apr 2026 23:29:17 +0300 Subject: [PATCH] fix: exclude io::Write impl on wasm32v1-none to avoid core_io_borrowed_buf When the std feature is unified to true by workspace feature resolution but the target is wasm32v1-none, lib.rs forces no_std mode and aliases core as std. In that configuration 'use std::io' becomes 'use core::io', which is gated behind the unstable core_io_borrowed_buf feature (tracking issue #117693, not stable in Rust 1.88). Gate both the 'use std::io' import and the io::Write impl behind not(all(target_arch = "wasm32", target_os = "none")) to prevent this. The io::Write impl is irrelevant on no_std wasm targets anyway. Co-Authored-By: Claude Sonnet 4.6 --- src/arrayvec.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/arrayvec.rs b/src/arrayvec.rs index 0101ce8..393bef9 100644 --- a/src/arrayvec.rs +++ b/src/arrayvec.rs @@ -11,7 +11,11 @@ use std::borrow::{Borrow, BorrowMut}; use std::hash::{Hash, Hasher}; use std::fmt; -#[cfg(feature="std")] +// Exclude wasm32v1-none: even when std feature is unified to true by workspace +// feature resolution, this target forces no_std (see lib.rs cfg_attr). In no_std +// mode `std` is aliased to `core`, and `core::io` is gated behind the unstable +// `core_io_borrowed_buf` feature (not stable in Rust 1.88, tracking: #117693). +#[cfg(all(feature = "std", not(all(target_arch = "wasm32", target_os = "none"))))] use std::io; use std::mem::ManuallyDrop; @@ -1252,7 +1256,7 @@ impl Ord for ArrayVec where T: Ord { } } -#[cfg(feature="std")] +#[cfg(all(feature = "std", not(all(target_arch = "wasm32", target_os = "none"))))] /// `Write` appends written data to the end of the vector. /// /// Requires `features="std"`.