diff --git a/.github/scripts/ci-common.sh b/.github/scripts/ci-common.sh index 35e450bdbd..0db925b015 100644 --- a/.github/scripts/ci-common.sh +++ b/.github/scripts/ci-common.sh @@ -10,7 +10,6 @@ cargo_toml=$project_root/Cargo.toml dummyvm_toml=$project_root/docs/dummyvm/Cargo.toml # Pin certain deps for our MSRV -cargo update -p home@0.5.11 --precise 0.5.5 # This can be removed once we move to Rust 1.81 or newer cargo update -p home@0.5.12 --precise 0.5.5 # This requires Rust edition 2024 # Repeat a command for all the features. Requires the command as one argument (with double quotes) diff --git a/.github/workflows/micro-bm.yml b/.github/workflows/micro-bm.yml index b54e55b921..244fa41472 100644 --- a/.github/workflows/micro-bm.yml +++ b/.github/workflows/micro-bm.yml @@ -69,7 +69,7 @@ jobs: with: repository: mmtk/ci-perf-kit token: ${{ secrets.GITHUB_TOKEN }} - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit submodules: true # Use rust-toolchain in the trunk (it doesnt matter much - if the toolchains defined in the trunk and the branch are different, we cant run anyway) diff --git a/.github/workflows/perf-baseline.yml b/.github/workflows/perf-baseline.yml index 41018fa96e..6b7df87141 100644 --- a/.github/workflows/perf-baseline.yml +++ b/.github/workflows/perf-baseline.yml @@ -42,7 +42,7 @@ jobs: with: token: ${{ secrets.CI_ACCESS_TOKEN }} repository: mmtk/ci-perf-kit - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit submodules: true # setup @@ -94,7 +94,7 @@ jobs: with: token: ${{ secrets.CI_ACCESS_TOKEN }} repository: mmtk/ci-perf-kit - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit submodules: true # setup diff --git a/.github/workflows/perf-compare-ci.yml b/.github/workflows/perf-compare-ci.yml index 21b8a12e86..ad5fef083f 100644 --- a/.github/workflows/perf-compare-ci.yml +++ b/.github/workflows/perf-compare-ci.yml @@ -112,7 +112,7 @@ jobs: with: repository: mmtk/ci-perf-kit token: ${{ secrets.CI_ACCESS_TOKEN }} - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit submodules: true # setup @@ -223,7 +223,7 @@ jobs: with: repository: mmtk/ci-perf-kit token: ${{ secrets.CI_ACCESS_TOKEN }} - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit submodules: true # setup diff --git a/.github/workflows/perf-regression-ci.yml b/.github/workflows/perf-regression-ci.yml index 27f6fbd792..f3981f3a16 100644 --- a/.github/workflows/perf-regression-ci.yml +++ b/.github/workflows/perf-regression-ci.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v4 with: repository: mmtk/ci-perf-kit - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit token: ${{ secrets.CI_ACCESS_TOKEN }} submodules: true @@ -142,7 +142,7 @@ jobs: uses: actions/checkout@v4 with: repository: mmtk/ci-perf-kit - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit submodules: true # download canary build @@ -233,7 +233,7 @@ jobs: uses: actions/checkout@v4 with: repository: mmtk/ci-perf-kit - ref: "0.8.4" + ref: "0.8.5" path: ci-perf-kit token: ${{ secrets.CI_ACCESS_TOKEN }} submodules: true diff --git a/Cargo.toml b/Cargo.toml index 5ca7a0358e..7721a05f22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/mmtk/mmtk-core" readme = "README.md" categories = ["memory-management"] keywords = ["gc", "garbage", "collection", "garbage-collection", "allocation"] -rust-version = "1.74.1" +rust-version = "1.84" build = "build.rs" [lib] @@ -59,24 +59,9 @@ paste = "1.0.8" rand = "0.9.0" rand_chacha = "0.9.0" criterion = "0.5" -# Note: `half` v2.5.0 started to require Rust 1.81. -# `criterion` transitively depends on `half` via the dependency chain: -# criterion -> ciborium -> ciborium_ll -> half -# The MSRV of `ciborium` v0.2.2 is declared as 1.58, and is declared to depend on `half` v2.2. -# Ciborium should either bump its MSRV or select a version of `half` that satisfies its current MSRV. -# We lock the version of `half` to 2.4.1 to workaround this. -# TODO: When we bump MSRV to 1.84 or above, we can rely on Cargo's MSRV-aware dependency resolver and remove such workarounds. -half = "=2.4.1" [build-dependencies] built = { version = "0.7.7", features = ["git2"] } -# Note: Some components in ICU4X started to require Rust 1.81 since some versions, such as `litemap` v0.7.5. -# The `built` crate depends on ICU4X via the dependency chain: -# built -> git2 -> url -> idna -> idna_adapter --(default)--------> crates from the ICU4X projects -# --(alternatively)--> `unicode-rs` -# But we don't need ICU4X (or even `url`) because we only use `git2` to get the Git commit hash. -# We move away from ICU4X completely following the instruction in https://docs.rs/crate/idna_adapter/1.2.0 -idna_adapter = "=1.1.0" [lints.clippy] # Allow this. Clippy suggests we should use Sft, Mmtk, rather than SFT and MMTK. @@ -88,10 +73,9 @@ idna_adapter = "=1.1.0" # to me - considering it will break our API and all the efforts for all the developers to make the change, it may # not worth it. upper_case_acronyms = "allow" -# Temporarily allow this -- 9 July 2025. Clippy suggests that we should always inline format args if possible. -# We see pushbacks on this lint in Rust 1.67, and the lint was downgraded to pedantic in 1.67.1. It was upgraded -# again in Rust 1.88. We temporarily disable this lint and see the reaction from the community. -# If there is no pushback for this lint in a few momnths' time, we should remove the following line and migrate the codebase. +# Allow this -- 9 July 2025. Clippy suggests that we should always inline format args if possible. +# This lint was upgraded to 'style' in Rust 1.67, and then was downgraded to pedantic in 1.67.1. +# It was upgraded again in Rust 1.88, and downgraded again in Rust 1.89. We disable this lint to avoid warnings in affected versions. # See https://github.com/mmtk/mmtk-core/issues/1334. uninlined_format_args = "allow" diff --git a/rust-toolchain b/rust-toolchain index 6b4de0a42b..7f229af964 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.83.0 +1.92.0 diff --git a/src/policy/sft_map.rs b/src/policy/sft_map.rs index 7c499128e7..42ed3f3db7 100644 --- a/src/policy/sft_map.rs +++ b/src/policy/sft_map.rs @@ -141,7 +141,9 @@ impl SFTRefStorage { let val = self.0.load(Ordering::Acquire); // Provenance-related APIs were stabilized in Rust 1.84. // Rust 1.91 introduced the warn-by-default lint `integer_to_ptr_transmutes`. - // Since our MSRV is still 1.74.1, we can't fix it until bumping MSRV. + // However, pointer provenance API only works for ptr-sized intergers, and + // here we are transmuting from a double-word sized integer to a fat pointer. + // We still need to use transmute here. #[allow(unknown_lints)] #[allow(integer_to_ptr_transmutes)] unsafe { diff --git a/src/util/alloc/allocator.rs b/src/util/alloc/allocator.rs index 32a4138a47..cf810935b8 100644 --- a/src/util/alloc/allocator.rs +++ b/src/util/alloc/allocator.rs @@ -172,13 +172,9 @@ pub fn align_allocation_inner( } // May require an alignment - let region_isize = region.as_usize() as isize; let mask = (alignment - 1) as isize; // fromIntSignExtend let neg_off: isize = -(offset as isize); // fromIntSignExtend - - // TODO: Consider using neg_off.wrapping_sub_unsigned(region.as_usize()), and we can remove region_isize. - // This requires Rust 1.66.0+. - let delta = neg_off.wrapping_sub(region_isize) & mask; // Use wrapping_sub to avoid overflow + let delta = neg_off.wrapping_sub_unsigned(region.as_usize()) & mask; // Use wrapping_sub to avoid overflow if fillalignmentgap && (VM::ALIGNMENT_VALUE != 0) { fill_alignment_gap::(region, region + delta); diff --git a/src/util/erase_vm.rs b/src/util/erase_vm.rs index 098d1a850c..adc092c70e 100644 --- a/src/util/erase_vm.rs +++ b/src/util/erase_vm.rs @@ -17,17 +17,13 @@ macro_rules! define_erased_vm_mut_ref { pub struct $new_type<'a>(usize, PhantomData<&'a ()>); impl<'a> $new_type<'a> { pub fn new(r: &'a mut $orig_type) -> Self { - let worker_as_usize: usize = unsafe { std::mem::transmute(r) }; + let worker_as_usize: usize = (r as *mut $orig_type).expose_provenance(); Self(worker_as_usize, PhantomData) } pub fn into_mut(self) -> &'a mut $orig_type { - // Provenance-related APIs were stabilized in Rust 1.84. - // Rust 1.91 introduced the warn-by-default lint `integer_to_ptr_transmutes`. - // Since our MSRV is still 1.74.1, we can't fix it until bumping MSRV. - #[allow(unknown_lints)] - #[allow(integer_to_ptr_transmutes)] unsafe { - std::mem::transmute(self.0) + &mut *(std::ptr::with_exposed_provenance(self.0) as *const $orig_type + as *mut $orig_type) } } }