diff options
author | 2025-06-09 16:17:35 +0200 | |
---|---|---|
committer | 2025-06-11 21:13:56 +0200 | |
commit | b3b4f760ccf2d08ff3db0f094c32ce70bba2eb15 (patch) | |
tree | ea26c2f5863acf813808805d2e06eecd43fcc76e | |
parent | rust: pin-init: examples: pthread_mutex: disable the main test for miri (diff) | |
download | wireguard-linux-b3b4f760ccf2d08ff3db0f094c32ce70bba2eb15.tar.xz wireguard-linux-b3b4f760ccf2d08ff3db0f094c32ce70bba2eb15.zip |
rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature
When trying to run `cargo check --all-targets --no-default-features`, an
error is reported by the test, as it cannot find the `std` crate. This
is to be expected, since the `--no-default-features` flag enables the
`no-std` behavior of the crate. Thus exclude the test in that scenario.
Link: https://github.com/Rust-for-Linux/pin-init/pull/50/commits/2813729ccacdedee9dbfcab1ed285b8721a0391b
Link: https://lore.kernel.org/all/20250523125424.192843-4-lossin@kernel.org
[ Changed my author email address to @kernel.org. - Benno ]
Signed-off-by: Benno Lossin <lossin@kernel.org>
-rw-r--r-- | rust/pin-init/src/__internal.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/pin-init/src/__internal.rs b/rust/pin-init/src/__internal.rs index 557b5948cddc..90f18e9a2912 100644 --- a/rust/pin-init/src/__internal.rs +++ b/rust/pin-init/src/__internal.rs @@ -188,6 +188,7 @@ impl<T> StackInit<T> { } #[test] +#[cfg(feature = "std")] fn stack_init_reuse() { use ::std::{borrow::ToOwned, println, string::String}; use core::pin::pin; |