diff --git a/tests/compile-fail/validity/nonzero.rs b/tests/compile-fail/validity/nonzero.rs index d1de0f8095e3..f820b0e810b8 100644 --- a/tests/compile-fail/validity/nonzero.rs +++ b/tests/compile-fail/validity/nonzero.rs @@ -7,5 +7,5 @@ pub(crate) struct NonZero(pub(crate) T); fn main() { // Make sure that we detect this even when no function call is happening along the way - let _x = Some(NonZero(0)); //~ ERROR encountered 0, but expected something greater or equal to 1 + let _x = Some(unsafe { NonZero(0) }); //~ ERROR encountered 0, but expected something greater or equal to 1 }