Skip to content

Commit 7ade788

Browse files
committed
Fixup tests trying to get miri to work.
Turns out it won't due to: rust-lang/unsafe-code-guidelines#134 so disable that check
1 parent 0c21a2a commit 7ade788

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.github/workflows/safety.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: cargo miri test
6363
run: cargo miri test
6464
env:
65-
MIRIFLAGS: "-Zmiri-disable-isolation"
65+
MIRIFLAGS: "-Zmiri-disable-isolation,-Zmiri-disable-stacked-borrows"
6666
#loom:
6767
# runs-on: ubuntu-latest
6868
# steps:

cpu/src/tests.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ macro_rules! init_test {
183183
let mut cpu = setup($type, 0x1212, 0xEA, None, None, None, None);
184184

185185
// This should fail
186-
{
187-
assert!(cpu.reset().is_err(), "reset worked before power_on");
188-
}
186+
assert!(cpu.reset().is_err(), "reset worked before power_on");
189187

190188
// Now it should work.
191189
cpu.power_on()?;
@@ -196,10 +194,7 @@ macro_rules! init_test {
196194
}
197195

198196
// This should fail now.
199-
{
200-
let ret = cpu.power_on();
201-
assert!(ret.is_err(), "power_on passes twice");
202-
}
197+
assert!(cpu.power_on().is_err(), "power_on passes twice");
203198
}
204199
if $rand {
205200
assert!(track.len() == 2, "didn't get both decimal states");

0 commit comments

Comments
 (0)