From f72a18884802765c56b945bb382f76e3079dff37 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Tue, 19 Sep 2023 23:53:46 +0000 Subject: [PATCH] Fail compilation on targets w/o soundness proof TODO: Figure out how to make sure we block the next minor version release on adding back all of the targets that people actually rely on. Makes progress on #383 --- src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 62005ad6a6..f4512c845f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -214,6 +214,21 @@ mod zerocopy { pub(crate) use crate::*; } +#[cfg(not(any( + target_arch = "i686", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "arm", + target_arch = "aarch64", +)))] +compile_error!( +r#"Zerocopy has not been proven sound on this architecture. + +This doesn't mean that it is unsound - just that we haven't gotten around to +proving it sound. If you need support for this architecture, let us know and +we'll prioritize it: https://github.com/google/zerocopy/issues/383"# +); + #[rustversion::nightly] #[cfg(all(test, not(__INTERNAL_USE_ONLY_NIGHLTY_FEATURES_IN_TESTS)))] const _: () = {