Skip to content

Commit

Permalink
rust: bump MSRV to 1.76.0
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Seipp <[email protected]>
  • Loading branch information
thoughtpolice committed Feb 9, 2024
1 parent b18201e commit 5b517b5
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: 1.71
toolchain: 1.76
- name: Build
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
- name: Test
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Breaking changes

* The minimum supported Rust version (MSRV) is now 1.76.0.

### New features

* Templates now support logical operators: `||`, `&&`, `!`
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = ["cli", "lib", "lib/testutils", "lib/gen-protos"]
[workspace.package]
version = "0.14.0"
license = "Apache-2.0"
rust-version = "1.71" # NOTE: remember to update CI, contributing.md, changelog.md, and flake.nix
rust-version = "1.76" # NOTE: remember to update CI, contributing.md, changelog.md, and flake.nix
edition = "2021"
readme = "README.md"
homepage = "https://github.com/martinvonz/jj"
Expand Down
1 change: 0 additions & 1 deletion cli/tests/test_git_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ fn test_git_clone_colocate() {
.symbolic_target()
);
// ".jj" directory should be ignored at Git side.
#[allow(unknown_lints)] // Needed for clippy <=1.71
#[allow(clippy::format_collect)]
let git_statuses: String = jj_git_repo
.statuses(None)
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jj config set --repo "revset-aliases.immutable_heads()" "main@origin | gh-pages@
One-time setup:

rustup toolchain add nightly # wanted for 'rustfmt'
rustup toolchain add 1.71 # also specified in Cargo.toml
rustup toolchain add 1.76 # also specified in Cargo.toml
cargo install cargo-insta
cargo install cargo-watch
cargo install cargo-nextest
Expand All @@ -131,7 +131,7 @@ During development (adapt according to your preference):

cargo watch --ignore '.jj/**' -s \
'cargo clippy --workspace --all-targets \
&& cargo +1.71 check --workspace --all-targets'
&& cargo +1.76 check --workspace --all-targets'
cargo +nightly fmt # Occasionally
cargo nextest run --workspace # Occasionally
cargo insta test --workspace --test-runner nextest # Occasionally
Expand Down Expand Up @@ -160,7 +160,7 @@ These are listed roughly in order of decreasing importance.
3. Your code will be rejected if it cannot be compiled with the minimal
supported version of Rust ("MSRV"). Currently, `jj` follows a rather
casual MSRV policy: "The current `rustc` stable version, minus one."
As of this writing, that version is **1.71.0**.
As of this writing, that version is **1.76.0**.

4. Your code needs to pass `cargo clippy`. You can also
use `cargo +nightly clippy` if you wish to see more warnings.
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
pkgs.lib.all (re: builtins.match re relPath == null) regexes;
};

rust-version = pkgs.rust-bin.stable."1.71.0".default;
rust-version = pkgs.rust-bin.stable."1.76.0".default;

ourRustPlatform = pkgs.makeRustPlatform {
rustc = rust-version;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/default_index/revset_graph_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl<'revset, 'index> RevsetGraphIterator<'revset, 'index> {
index_entry: &IndexEntry<'index>,
) -> &[IndexGraphEdge] {
let position = index_entry.position();
// `if let Some(edges) = ...` doesn't pass lifetime check as of Rust 1.71.0
// `if let Some(edges) = ...` doesn't pass lifetime check as of Rust 1.76.0
if self.edges.contains_key(&position) {
return self.edges.get(&position).unwrap();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/tree_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl TreeBuilder {
store: &Arc<Store>,
dir: &RepoPath,
) -> &'a Tree {
// `if let Some(tree) = ...` doesn't pass lifetime check as of Rust 1.69.0
// `if let Some(tree) = ...` doesn't pass lifetime check as of Rust 1.76.0
if tree_cache.contains_key(dir) {
return tree_cache.get(dir).unwrap();
}
Expand Down
4 changes: 0 additions & 4 deletions lib/tests/test_local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// TODO: Remove when MSRV passes 1.72
// https://github.com/frondeus/test-case/issues/126#issuecomment-1635916592
#![allow(clippy::items_after_test_module)]

use std::fs::OpenOptions;
use std::io::Write;
#[cfg(unix)]
Expand Down
5 changes: 0 additions & 5 deletions lib/tests/test_revset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// this was supposed to be fixed in 1.71.0, but barely missed the cut.
// can be released after we bump MSRV to 1.72.0, see:
// https://github.com/frondeus/test-case/issues/126#issuecomment-1635916592
#![allow(clippy::items_after_test_module)]

use std::path::Path;

use assert_matches::assert_matches;
Expand Down

0 comments on commit 5b517b5

Please sign in to comment.