diff --git a/sdk/clock/src/lib.rs b/sdk/clock/src/lib.rs index 870265f9c18eb9..d8006a9ec408f3 100644 --- a/sdk/clock/src/lib.rs +++ b/sdk/clock/src/lib.rs @@ -19,6 +19,7 @@ //! validator set][oracle]. //! //! [oracle]: https://docs.solanalabs.com/implemented-proposals/validator-timestamp-oracle +#![no_std] #[cfg(feature = "serde")] use serde_derive::{Deserialize, Serialize}; diff --git a/sdk/macro/src/lib.rs b/sdk/macro/src/lib.rs index df56e1e71ffc38..e3380712ef9d1a 100644 --- a/sdk/macro/src/lib.rs +++ b/sdk/macro/src/lib.rs @@ -319,7 +319,7 @@ pub fn derive_clone_zeroed(input: proc_macro::TokenStream) -> proc_macro::TokenS syn::Fields::Named(ref fields) => fields.named.iter().map(|f| { let name = &f.ident; quote! { - std::ptr::addr_of_mut!((*ptr).#name).write(self.#name); + core::ptr::addr_of_mut!((*ptr).#name).write(self.#name); } }), _ => unimplemented!(), @@ -332,9 +332,9 @@ pub fn derive_clone_zeroed(input: proc_macro::TokenStream) -> proc_macro::TokenS // This is not the case here, and intentionally so because we want to // guarantee zeroed padding. fn clone(&self) -> Self { - let mut value = std::mem::MaybeUninit::::uninit(); + let mut value = core::mem::MaybeUninit::::uninit(); unsafe { - std::ptr::write_bytes(&mut value, 0, 1); + core::ptr::write_bytes(&mut value, 0, 1); let ptr = value.as_mut_ptr(); #(#clone_statements)* value.assume_init()