Skip to content

Commit 2a92a98

Browse files
committed
improved no_std support
1 parent 1dd6368 commit 2a92a98

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Cargo.toml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name = "ialloc"
55
version = "0.0.0-2025-04-07"
66
edition = "2021"
7-
rust-version = "1.69.0" # MSRV: CARGO_BIN_NAME in examples/nightly/stable-main-stub.rs
7+
rust-version = "1.81.0" # MSRV: mcom = "0.1.5"
88

99
license = "Apache-2.0 OR MIT"
1010
authors = ["MaulingMonkey <[email protected]>"]
@@ -35,8 +35,8 @@ panicy = ["panicy-bounds", "panicy-memory"]
3535
panicy-bounds = [] # XXX: not yet used for anything, undocumented as such
3636
panicy-memory = [] # ≈ not(no_global_oom_handling)
3737

38-
alloc = ["bytemuck/extern_crate_alloc"]
39-
std = ["alloc", "bytemuck/extern_crate_std"]
38+
alloc = ["bytemuck/extern_crate_alloc", "mcom/alloc"]
39+
std = ["alloc", "bytemuck/extern_crate_std", "mcom/std"]
4040
win32 = ["winapi", "winresult"]
4141
msvc = ["libc"]
4242

@@ -65,9 +65,9 @@ cc.optional = true
6565
[dependencies]
6666
bytemuck.version = "1"
6767
bytemuck.features = [ # automatically opt into features that exist only to protect MSRV
68-
"zeroable_maybe_uninit", # requires MSRV 1.36.0, ialloc has MSRV 1.69.0
69-
"min_const_generics", # requires MSRV 1.51.0, ialloc has MSRV 1.69.0
70-
"zeroable_atomics", # requires MSRV 1.60.0, ialloc has MSRV 1.69.0
68+
"zeroable_maybe_uninit", # requires MSRV 1.36.0, ialloc has MSRV 1.81.0
69+
"min_const_generics", # requires MSRV 1.51.0, ialloc has MSRV 1.81.0
70+
"zeroable_atomics", # requires MSRV 1.60.0, ialloc has MSRV 1.81.0
7171
]
7272

7373
lazy_static.version = "1"
@@ -77,7 +77,12 @@ libc.version = "0.2"
7777
libc.optional = true
7878

7979
[target.'cfg(windows)'.dependencies]
80-
mcom.version = "0.1"
80+
mcom.version = "0.1.5" # `alloc` and `std` features
81+
mcom.default-features = false
82+
mcom.features = [
83+
"windows-2000",
84+
"winapi-family-all",
85+
]
8186
winapi.version = "0.3"
8287
winapi.optional = true
8388
winapi.features = [

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.69.0" # MSRV: CARGO_BIN_NAME in examples/nightly/stable-main-stub.rs
2+
channel = "1.81.0" # MSRV: mcom = "0.1.5"

src/allocator/simple/fixed_pool.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ type Element<const A : usize, const B : usize> = UnsafeCell<MaybeUninit<AlignN<A
209209
ABox::try_new_in(next, &pool).unwrap()
210210
});
211211
assert!(ABox::try_new_in(0u32, &pool).is_err(), "pool out of elements");
212-
std::dbg!(&_integers[0]);
212+
let _ = &_integers[0];
213+
#[cfg(feature = "std")] std::dbg!(&_integers[0]);
213214
}
214215
}
215216

0 commit comments

Comments
 (0)