Skip to content

Commit a130270

Browse files
committed
Fix Miri
1 parent 2e2e188 commit a130270

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

stringleton/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ macro_rules! sym {
6565
};
6666
(@impl $sym:expr) => {{
6767
// Note: Using `crate` to refer to the calling crate - this is deliberate.
68-
#[cfg_attr(not(target_arch = "wasm32"), $crate::internal::linkme::distributed_slice(crate::_stringleton_enabled::TABLE))]
69-
#[cfg_attr(not(target_arch = "wasm32"), linkme(crate = $crate::internal::linkme))]
68+
#[cfg_attr(not(any(miri, target_arch = "wasm32")), $crate::internal::linkme::distributed_slice(crate::_stringleton_enabled::TABLE))]
69+
#[cfg_attr(not(any(miri, target_arch = "wasm32")), linkme(crate = $crate::internal::linkme))]
7070
static SITE: $crate::internal::Site = $crate::internal::Site::new(&$sym);
7171
unsafe {
7272
// SAFETY: This site will be initialized by the static ctor because
@@ -183,7 +183,7 @@ macro_rules! static_sym {
183183
macro_rules! enable {
184184
() => {
185185
#[doc(hidden)]
186-
#[cfg(not(target_arch = "wasm32"))]
186+
#[cfg(not(any(miri, target_arch = "wasm32")))]
187187
pub(crate) mod _stringleton_enabled {
188188
#[$crate::internal::linkme::distributed_slice]
189189
#[linkme(crate = $crate::internal::linkme)]
@@ -204,11 +204,12 @@ macro_rules! enable {
204204

205205
#[allow(unused)]
206206
#[doc(hidden)]
207-
#[cfg(not(target_arch = "wasm32"))]
207+
#[cfg(not(any(miri, target_arch = "wasm32")))]
208208
pub use _stringleton_enabled::_stringleton_register_symbols;
209209
};
210210
($krate:path) => {
211211
#[doc(hidden)]
212+
#[cfg(not(any(miri, target_arch = "wasm32")))]
212213
pub(crate) use $krate::_stringleton_enabled;
213214
};
214215
}
@@ -233,7 +234,7 @@ mod tests {
233234

234235
use hashbrown::HashMap;
235236

236-
use super::{StaticSymbol, Symbol, static_sym, sym};
237+
use super::{StaticSymbol, Symbol};
237238

238239
#[test]
239240
#[cfg(feature = "alloc")]

0 commit comments

Comments
 (0)