From fcf2ef8da58179fbb96121ca39c0149b84f038f2 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 31 Oct 2024 22:32:50 -0700 Subject: [PATCH] Compile &raw test on Rust 1.82+ only --- tests/test_ensure.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_ensure.rs b/tests/test_ensure.rs index 9660df7..b43490a 100644 --- a/tests/test_ensure.rs +++ b/tests/test_ensure.rs @@ -184,7 +184,12 @@ fn test_unary() { let test = || Ok(ensure!(&mut x == *&&mut &2)); assert_err(test, "Condition failed: `&mut x == *&&mut &2` (1 vs 2)"); +} +#[rustversion::since(1.82)] +#[test] +fn test_raw_addr() { + let mut x = 1; let test = || Ok(ensure!(S + &raw const x != S + &raw mut x)); assert_err( test,