Skip to content

Commit

Permalink
Fail compilation on targets w/o soundness proof
Browse files Browse the repository at this point in the history
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
  • Loading branch information
joshlf committed Sep 19, 2023
1 parent cc7a0eb commit f72a188
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _: () = {
Expand Down

0 comments on commit f72a188

Please sign in to comment.