Skip to content

Commit

Permalink
Compile &raw test on Rust 1.82+ only
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 1, 2024
1 parent 1e7e9fe commit fcf2ef8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_ensure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fcf2ef8

Please sign in to comment.