File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,23 @@ use crate::env;
51
51
// The rules about what you can do in a `ctor` function are somewhat fuzzy,
52
52
// because Rust does not explicitly support constructors. But a scan of the
53
53
// stdlib suggests that reading environment variables is safe enough.
54
+ #[ cfg( not( miri) ) ]
54
55
#[ ctor:: ctor]
55
56
pub static SOFT_ASSERTIONS : AtomicBool = {
56
57
let default = cfg ! ( debug_assertions) || env:: is_var_truthy ( "MZ_SOFT_ASSERTIONS" ) ;
57
58
AtomicBool :: new ( default)
58
59
} ;
59
60
61
+ /// Always enable soft assertions when running [Miri].
62
+ ///
63
+ /// Note: Miri also doesn't support global constructors, aka [`ctor`], if it ever does we could
64
+ /// get rid of this second definition. See <https://github.com/rust-lang/miri/issues/450> for
65
+ /// more details.
66
+ ///
67
+ /// [Miri]: https://github.com/rust-lang/miri
68
+ #[ cfg( miri) ]
69
+ pub static SOFT_ASSERTIONS : AtomicBool = AtomicBool :: new ( true ) ;
70
+
60
71
/// Asserts that a condition is true if soft assertions are enabled.
61
72
///
62
73
/// Soft assertions have a small runtime cost even when disabled. See
Original file line number Diff line number Diff line change @@ -925,7 +925,6 @@ async fn test_stash_table(stash: &mut Stash) {
925
925
}
926
926
927
927
#[ test]
928
- #[ cfg_attr( miri, ignore) ] // Broken, see #18122
929
928
fn test_table ( ) {
930
929
fn uniqueness_violation ( a : & String , b : & String ) -> bool {
931
930
a == b
You can’t perform that action at this time.
0 commit comments