We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf31e76 commit 0b5c758Copy full SHA for 0b5c758
tests/test_ensure.rs
@@ -11,6 +11,7 @@ use std::fmt::Debug;
11
use std::iter;
12
use std::marker::PhantomData;
13
use std::ops::Add;
14
+use std::ptr;
15
16
struct S;
17
@@ -262,10 +263,11 @@ fn test_atom() {
262
263
"Condition failed: `S + async move { 1 } == true` (false vs true)",
264
);
265
- let test = || Ok(ensure!(S + unsafe { 1 } == true));
266
+ let x = &1;
267
+ let test = || Ok(ensure!(S + unsafe { ptr::read(x) } == true));
268
assert_err(
269
test,
- "Condition failed: `S + unsafe { 1 } == true` (false vs true)",
270
+ "Condition failed: `S + unsafe { ptr::read(x) } == true` (false vs true)",
271
272
}
273
0 commit comments