Skip to content

Commit f72a188

Browse files
committed
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
1 parent cc7a0eb commit f72a188

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/lib.rs

+15
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,21 @@ mod zerocopy {
214214
pub(crate) use crate::*;
215215
}
216216

217+
#[cfg(not(any(
218+
target_arch = "i686",
219+
target_arch = "x86",
220+
target_arch = "x86_64",
221+
target_arch = "arm",
222+
target_arch = "aarch64",
223+
)))]
224+
compile_error!(
225+
r#"Zerocopy has not been proven sound on this architecture.
226+
227+
This doesn't mean that it is unsound - just that we haven't gotten around to
228+
proving it sound. If you need support for this architecture, let us know and
229+
we'll prioritize it: https://github.com/google/zerocopy/issues/383"#
230+
);
231+
217232
#[rustversion::nightly]
218233
#[cfg(all(test, not(__INTERNAL_USE_ONLY_NIGHLTY_FEATURES_IN_TESTS)))]
219234
const _: () = {

0 commit comments

Comments
 (0)