Skip to content

Commit df5e0cd

Browse files
authored
Bump MSRV to 1.74.1 (#1276)
The current latest version of the "built" crate (v0.7.7) requires MSRV 1.74. We bump the MSRV to 1.74.1. Since version 0.7.6 of the "built" crate, it generates `static` items instead of `const` items for `PKG_VERSION`, `FEATURES_STR`, etc. Our `build_info.rs` used to define `const` items that take their values. After this change, the Rust compiler now interpret those lines as taking references of `static` items, which is unstable until Rust 1.83. We instead replaced those `const` items in `build_info.rs` with `use` statements that create aliases of the items generated by "built". Bumping MSRV to 1.74.1 also allows us to bump the version of the dependency "criterion" to 0.5 which also requires MSRV 1.74. Previously, we locked the version of "criterion" to 0.4 due to its MSRV requirement. We also updated all dependencies to their latest versions. Among those changes, the "sysinfo" crate renamed several `new` methods to `nothing`. We make changes accordingly. We also use `usize::div_ceil` which was introduced in Rust 1.73. This fixes a clippy warning.
1 parent 4ca8812 commit df5e0cd

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repository = "https://github.com/mmtk/mmtk-core"
1010
readme = "README.md"
1111
categories = ["memory-management"]
1212
keywords = ["gc", "garbage", "collection", "garbage-collection", "allocation"]
13-
rust-version = "1.71.1"
13+
rust-version = "1.74.1"
1414
build = "build.rs"
1515

1616
[lib]
@@ -25,12 +25,12 @@ atomic-traits = "0.4.0"
2525
bytemuck = { version = "1.14.0", features = ["derive"] }
2626
cfg-if = "1.0"
2727
crossbeam = "0.8.1"
28-
delegate = "0.12.0"
29-
downcast-rs = "1.1.1"
28+
delegate = "0.13.2"
29+
downcast-rs = "2.0.1"
3030
enum-map = "2.4.2"
3131
env_logger = { version = "0.11.3", optional = true }
3232
is-terminal = "0.4.7"
33-
itertools = "0.12.0"
33+
itertools = "0.14.0"
3434
jemalloc-sys = { version = "0.5.3", features = ["disable_initial_exec_tls"], optional = true }
3535
lazy_static = "1.1"
3636
libc = "0.2"
@@ -48,18 +48,18 @@ regex = "1.7.0"
4848
rustversion = "1.0"
4949
spin = "0.9.5"
5050
static_assertions = "1.1.0"
51-
strum = "0.26.2"
52-
strum_macros = "0.26.2"
53-
sysinfo = "0.30.9"
51+
strum = "0.27.1"
52+
strum_macros = "0.27.1"
53+
sysinfo = "0.33.1"
5454

5555
[dev-dependencies]
5656
paste = "1.0.8"
57-
rand = "0.8.5"
58-
rand_chacha = "0.3.1"
59-
criterion = "0.4"
57+
rand = "0.9.0"
58+
rand_chacha = "0.9.0"
59+
criterion = "0.5"
6060

6161
[build-dependencies]
62-
built = { version = "0.7.1", features = ["git2"] }
62+
built = { version = "0.7.7", features = ["git2"] }
6363

6464
[[bench]]
6565
name = "main"

src/build_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ mod raw {
77
}
88

99
/// MMTk crate version such as 0.14.0
10-
pub const MMTK_PKG_VERSION: &str = raw::PKG_VERSION;
10+
pub use raw::PKG_VERSION as MMTK_PKG_VERSION;
1111

1212
/// Comma separated features enabled for this build
13-
pub const MMTK_FEATURES: &str = raw::FEATURES_STR;
13+
pub use raw::FEATURES_STR as MMTK_FEATURES;
1414

1515
lazy_static! {
1616
/// Git version as short commit hash, such as a96e8f9, or a96e8f9-dirty, or unknown-git-version if MMTk

src/policy/marksweepspace/native_ms/block_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ pub(crate) fn pages_used_by_blocklists(lists: &BlockLists) -> usize {
310310
/// i.e. byte size == `wsize*sizeof(void*)`
311311
/// adapted from _mi_wsize_from_size in mimalloc
312312
fn mi_wsize_from_size(size: usize) -> usize {
313-
(size + MI_INTPTR_SIZE - 1) / MI_INTPTR_SIZE
313+
size.div_ceil(MI_INTPTR_SIZE)
314314
}
315315

316316
pub fn mi_bin<VM: VMBinding>(size: usize, align: usize) -> usize {

src/util/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ pub(crate) fn get_system_total_memory() -> u64 {
465465
// `Options`. If we only load memory-related components on start-up, it should only take <1ms
466466
// to initialize the `System` instance.
467467
let sys = System::new_with_specifics(
468-
RefreshKind::new().with_memory(MemoryRefreshKind::new().with_ram()),
468+
RefreshKind::nothing().with_memory(MemoryRefreshKind::nothing().with_ram()),
469469
);
470470
sys.total_memory()
471471
}

0 commit comments

Comments
 (0)