diff --git a/xilem_core/src/lib.rs b/xilem_core/src/lib.rs index 5ec218b8..d0fc939c 100644 --- a/xilem_core/src/lib.rs +++ b/xilem_core/src/lib.rs @@ -23,12 +23,16 @@ #![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))] // END LINEBENDER LINT SET #![cfg_attr(docsrs, feature(doc_auto_cfg))] -#![cfg_attr(not(test), no_std)] #![forbid(unsafe_code)] +#![no_std] // TODO: Remove any items listed as "Deferred" #![expect(clippy::allow_attributes_without_reason, reason = "Deferred: Noisy")] extern crate alloc; +// Used only for ad-hoc debugging of tests +#[cfg(test)] +extern crate std; + mod deferred; pub use deferred::{AsyncCtx, MessageProxy, PhantomView, ProxyError, RawProxy}; diff --git a/xilem_core/src/message.rs b/xilem_core/src/message.rs index ff0b071a..b80a270f 100644 --- a/xilem_core/src/message.rs +++ b/xilem_core/src/message.rs @@ -122,6 +122,8 @@ pub trait ViewMessage { #[cfg(test)] mod tests { use alloc::boxed::Box; + use alloc::format; + use alloc::string::{String, ToString}; use core::fmt::Debug; use crate::DynMessage; diff --git a/xilem_core/src/views/orphan.rs b/xilem_core/src/views/orphan.rs index 2ad8d40e..e92684c5 100644 --- a/xilem_core/src/views/orphan.rs +++ b/xilem_core/src/views/orphan.rs @@ -1,12 +1,6 @@ // Copyright 2024 the Xilem Authors // SPDX-License-Identifier: Apache-2.0 -#![allow( - // TODO: Instead of being conditionally no_std, instead conditionally use `extern crate std` - unused_qualifications, - reason = "We have `std` enabled when testing, which means that some items are conditionally in the prelude" -)] - use crate::{ DynMessage, MessageResult, Mut, View, ViewElement, ViewId, ViewMarker, ViewPathTracker, };