Skip to content

Commit 3b95bf9

Browse files
authored
Merge pull request rust-lang#132 from oli-obk/master
we cannot panic, thus `panicking` always returns false
2 parents 14d7501 + f6fbd06 commit 3b95bf9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/terminator/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,15 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
305305
"std::env::args" => return Err(EvalError::Unimplemented("miri does not support program arguments".to_owned())),
306306
"std::panicking::rust_panic_with_hook" |
307307
"std::rt::begin_panic_fmt" => return Err(EvalError::Panic),
308+
"std::panicking::panicking" |
309+
"std::rt::panicking" => {
310+
let (lval, block) = destination.expect("std::rt::panicking does not diverge");
311+
// we abort on panic -> `std::rt::panicking` always returns true
312+
let bool = self.tcx.types.bool;
313+
self.write_primval(lval, PrimVal::from_bool(false), bool)?;
314+
self.goto_block(block);
315+
return Ok(());
316+
}
308317
_ => {},
309318
}
310319
return Err(EvalError::NoMirFor(path));

tests/compile-fail/send-is-not-static-par-for.rs renamed to tests/run-pass/send-is-not-static-par-for.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//error-pattern: no mir for `std::
11+
//ignore-windows-gnu
1212

1313
use std::sync::Mutex;
1414

0 commit comments

Comments
 (0)