Skip to content

Commit ca302d6

Browse files
committed
feat!: Bump MSRV to 1.85 (#2136)
Bumps the minimum supported rust version to 1.85, ~and migrates to the 2024 edition~. Most of the changes here are automated. The diff is quite noisy due to some changes in formatting, and me using this opportunity to auto--fix some optional clippy lints. It may be easier to check the changes per-commit. EDIT: Edition change has been left for a separate PR, as it's quite noisy. BREAKING CHANGE: Bumped MSRV to 1.85
1 parent 4c9cce3 commit ca302d6

File tree

13 files changed

+16
-19
lines changed

13 files changed

+16
-19
lines changed

.github/workflows/ci-rs.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
id: toolchain
234234
uses: dtolnay/rust-toolchain@master
235235
with:
236-
toolchain: "1.75"
236+
toolchain: "1.85"
237237
- name: Install nightly toolchain
238238
uses: dtolnay/rust-toolchain@master
239239
with:
@@ -252,12 +252,10 @@ jobs:
252252
cargo binstall cargo-minimal-versions --force
253253
- name: Pin transitive dependencies not compatible with our MSRV
254254
# Add new dependencies as needed if the check fails due to
255-
# "package `XXX` cannot be built because it requires rustc YYY or newer, while the currently active rustc version is 1.75.0"
255+
# "package `XXX` cannot be built because it requires rustc YYY or newer, while the currently active rustc version is 1.85.0"
256256
run: |
257-
rm Cargo.lock
258-
cargo add -p hugr half@2.4.1
259-
cargo add -p hugr litemap@0.7.4
260-
cargo add -p hugr zerofrom@0.1.5
257+
# rm Cargo.lock
258+
# cargo add -p hugr half@2.4.1
261259
- name: Build with no features
262260
run: cargo minimal-versions --direct test --verbose --no-default-features --no-run
263261
- name: Tests with no features

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ repos:
7979
# built into a binary build (without using `maturin`)
8080
#
8181
# This feature list should be kept in sync with the `hugr-py/pyproject.toml`
82-
entry: cargo test --workspace --exclude 'hugr-py' --features 'hugr/extension_inference hugr/declarative hugr/model_unstable hugr/llvm hugr/llvm-test hugr/zstd'
82+
entry: cargo test --workspace --exclude 'hugr-py' --features 'hugr/extension_inference hugr/declarative hugr/llvm hugr/llvm-test hugr/zstd'
8383
language: system
8484
files: \.rs$
8585
pass_filenames: false

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ members = [
1515
default-members = ["hugr", "hugr-core", "hugr-passes", "hugr-cli", "hugr-model"]
1616

1717
[workspace.package]
18-
rust-version = "1.75"
18+
rust-version = "1.85"
1919
edition = "2021"
2020
homepage = "https://github.com/CQCL/hugr"
2121
repository = "https://github.com/CQCL/hugr"

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ shell by setting up [direnv](https://devenv.sh/automatic-shell-activation/).
2929
To setup the environment manually you will need:
3030

3131
- Just: https://just.systems/
32-
- Rust `>=1.75`: https://www.rust-lang.org/tools/install
32+
- Rust `>=1.85`: https://www.rust-lang.org/tools/install
3333
- uv `>=0.3`: docs.astral.sh/uv/getting-started/installation
3434
- Optional: capnproto `>=1.0`: https://capnproto.org/install.html
3535
Required when modifying the `hugr-model` serialization schema.

hugr-cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http:
6464

6565
[API documentation here]: https://docs.rs/hugr-cli/
6666
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
67-
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
67+
[msrv]: https://img.shields.io/crates/msrv/hugr-cli
6868
[crates]: https://img.shields.io/crates/v/hugr-cli
6969
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/hugr?logo=codecov
7070
[LICENSE]: https://github.com/CQCL/hugr/blob/main/LICENCE

hugr-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http:
3636

3737
[API documentation here]: https://docs.rs/hugr-core/
3838
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
39-
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
39+
[msrv]: https://img.shields.io/crates/msrv/hugr-core
4040
[crates]: https://img.shields.io/crates/v/hugr-core
4141
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/hugr?logo=codecov
4242
[LICENSE]: https://github.com/CQCL/hugr/blob/main/LICENCE

hugr-llvm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ See [DEVELOPMENT](DEVELOPMENT.md) for instructions on setting up the development
3232
This project is licensed under Apache License, Version 2.0 ([LICENCE](LICENCE) or <http://www.apache.org/licenses/LICENSE-2.0>).
3333

3434
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
35-
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
35+
[msrv]: https://img.shields.io/crates/msrv/hugr-llvm
3636
[hugr]: https://lib.rs/crates/hugr
3737
[inkwell]: https://thedan64.github.io/inkwell/inkwell/index.html
3838
[llvm-sys]: https://crates.io/crates/llvm-sys

hugr-model/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http:
3030

3131
[API documentation here]: https://docs.rs/hugr-model/
3232
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
33-
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
33+
[msrv]: https://img.shields.io/crates/msrv/hugr-model
3434
[crates]: https://img.shields.io/crates/v/hugr-core
3535
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/hugr?logo=codecov
3636
[LICENSE]: https://github.com/CQCL/hugr/blob/main/LICENCE

hugr-passes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http:
5151

5252
[API documentation here]: https://docs.rs/hugr-passes/
5353
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
54-
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
54+
[msrv]: https://img.shields.io/crates/msrv/hugr-passes
5555
[crates]: https://img.shields.io/crates/v/hugr-passes
5656
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/hugr?logo=codecov
5757
[LICENSE]: https://github.com/CQCL/hugr/blob/main/LICENCE

hugr-passes/src/replace_types/linearize.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::iter::repeat;
21
use std::{collections::HashMap, sync::Arc};
32

43
use hugr_core::builder::{
@@ -273,7 +272,7 @@ impl Linearizer for DelegatingLinearizer {
273272
let mut elems_for_copy = vec![vec![]; num_outports];
274273
for (inp, ty) in case_b.input_wires().zip_eq(variant.iter()) {
275274
let inp_copies = if ty.copyable() {
276-
repeat(inp).take(num_outports).collect::<Vec<_>>()
275+
std::iter::repeat_n(inp, num_outports).collect::<Vec<_>>()
277276
} else {
278277
self.copy_discard_op(ty, num_outports)?
279278
.add(&mut case_b, [inp])

0 commit comments

Comments
 (0)