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 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -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<T, const CAP: usize> Ord for ArrayVec<T, CAP> 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"`.
|
||||
|
||||
Reference in New Issue
Block a user