ok/jj
1
0
Fork 0
forked from mirrors/jj

rust: bump MSRV to 1.76.0

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2023-10-28 14:14:26 -05:00
parent b18201eff9
commit 5b517b542e
10 changed files with 10 additions and 18 deletions

View file

@ -29,7 +29,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with: with:
toolchain: 1.71 toolchain: 1.76
- name: Build - name: Build
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }} run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
- name: Test - name: Test

View file

@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Breaking changes ### Breaking changes
* The minimum supported Rust version (MSRV) is now 1.76.0.
### New features ### New features
* Templates now support logical operators: `||`, `&&`, `!` * Templates now support logical operators: `||`, `&&`, `!`

View file

@ -7,7 +7,7 @@ members = ["cli", "lib", "lib/testutils", "lib/gen-protos"]
[workspace.package] [workspace.package]
version = "0.14.0" version = "0.14.0"
license = "Apache-2.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" edition = "2021"
readme = "README.md" readme = "README.md"
homepage = "https://github.com/martinvonz/jj" homepage = "https://github.com/martinvonz/jj"

View file

@ -198,7 +198,6 @@ fn test_git_clone_colocate() {
.symbolic_target() .symbolic_target()
); );
// ".jj" directory should be ignored at Git side. // ".jj" directory should be ignored at Git side.
#[allow(unknown_lints)] // Needed for clippy <=1.71
#[allow(clippy::format_collect)] #[allow(clippy::format_collect)]
let git_statuses: String = jj_git_repo let git_statuses: String = jj_git_repo
.statuses(None) .statuses(None)

View file

@ -122,7 +122,7 @@ jj config set --repo "revset-aliases.immutable_heads()" "main@origin | gh-pages@
One-time setup: One-time setup:
rustup toolchain add nightly # wanted for 'rustfmt' 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-insta
cargo install cargo-watch cargo install cargo-watch
cargo install cargo-nextest cargo install cargo-nextest
@ -131,7 +131,7 @@ During development (adapt according to your preference):
cargo watch --ignore '.jj/**' -s \ cargo watch --ignore '.jj/**' -s \
'cargo clippy --workspace --all-targets \ 'cargo clippy --workspace --all-targets \
&& cargo +1.71 check --workspace --all-targets' && cargo +1.76 check --workspace --all-targets'
cargo +nightly fmt # Occasionally cargo +nightly fmt # Occasionally
cargo nextest run --workspace # Occasionally cargo nextest run --workspace # Occasionally
cargo insta test --workspace --test-runner nextest # Occasionally cargo insta test --workspace --test-runner nextest # Occasionally
@ -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 3. Your code will be rejected if it cannot be compiled with the minimal
supported version of Rust ("MSRV"). Currently, `jj` follows a rather supported version of Rust ("MSRV"). Currently, `jj` follows a rather
casual MSRV policy: "The current `rustc` stable version, minus one." 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 4. Your code needs to pass `cargo clippy`. You can also
use `cargo +nightly clippy` if you wish to see more warnings. use `cargo +nightly clippy` if you wish to see more warnings.

View file

@ -35,7 +35,7 @@
pkgs.lib.all (re: builtins.match re relPath == null) regexes; 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 { ourRustPlatform = pkgs.makeRustPlatform {
rustc = rust-version; rustc = rust-version;

View file

@ -167,7 +167,7 @@ impl<'revset, 'index> RevsetGraphIterator<'revset, 'index> {
index_entry: &IndexEntry<'index>, index_entry: &IndexEntry<'index>,
) -> &[IndexGraphEdge] { ) -> &[IndexGraphEdge] {
let position = index_entry.position(); 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) { if self.edges.contains_key(&position) {
return self.edges.get(&position).unwrap(); return self.edges.get(&position).unwrap();
} }

View file

@ -129,7 +129,7 @@ impl TreeBuilder {
store: &Arc<Store>, store: &Arc<Store>,
dir: &RepoPath, dir: &RepoPath,
) -> &'a Tree { ) -> &'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) { if tree_cache.contains_key(dir) {
return tree_cache.get(dir).unwrap(); return tree_cache.get(dir).unwrap();
} }

View file

@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // 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::fs::OpenOptions;
use std::io::Write; use std::io::Write;
#[cfg(unix)] #[cfg(unix)]

View file

@ -12,11 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // 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 std::path::Path;
use assert_matches::assert_matches; use assert_matches::assert_matches;