From bb4415413906bb01341c7fb852d2b0af17046d9b Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Mon, 4 Nov 2024 20:23:39 -0800 Subject: [PATCH] Bump msrv to 1.81 CI is breaking because of dev dependencies with newer rust version requirement. 1.66 is pretty old now too. --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- benches/int_benchmark.rs | 2 ++ benches/large_values_benchmark.rs | 2 ++ benches/syscall_benchmark.rs | 3 +++ benches/userspace_cache_benchmark.rs | 2 ++ examples/special_values.rs | 1 + rust-toolchain | 2 +- src/transactions.rs | 1 + src/tree_store/page_store/header.rs | 5 ++++- tests/basic_tests.rs | 2 +- 11 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe73dd70..abd48595 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: Install Rust if: steps.rust-cache.outputs.cache-hit != 'true' run: | - rustup default 1.66 + rustup default 1.81 rustup component add rustfmt rustup component add clippy diff --git a/Cargo.toml b/Cargo.toml index caa42059..ec374407 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" version = "2.2.0" edition = "2021" -rust-version = "1.66" +rust-version = "1.81" authors = ["Christopher Berner "] exclude = ["fuzz/"] diff --git a/benches/int_benchmark.rs b/benches/int_benchmark.rs index 43c5942e..4ba25430 100644 --- a/benches/int_benchmark.rs +++ b/benches/int_benchmark.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use std::env::current_dir; use std::fs; use tempfile::{NamedTempFile, TempDir}; diff --git a/benches/large_values_benchmark.rs b/benches/large_values_benchmark.rs index 06088ba0..37789905 100644 --- a/benches/large_values_benchmark.rs +++ b/benches/large_values_benchmark.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use std::env::current_dir; use tempfile::{NamedTempFile, TempDir}; diff --git a/benches/syscall_benchmark.rs b/benches/syscall_benchmark.rs index 18503b30..ae06837d 100644 --- a/benches/syscall_benchmark.rs +++ b/benches/syscall_benchmark.rs @@ -119,6 +119,7 @@ fn uring_bench(path: &Path) { let mut file = OpenOptions::new() .read(true) .write(true) + .truncate(true) .create(true) .open(path) .unwrap(); @@ -206,6 +207,7 @@ fn readwrite_bench(path: &Path) { let mut file = OpenOptions::new() .read(true) .write(true) + .truncate(true) .create(true) .open(path) .unwrap(); @@ -268,6 +270,7 @@ fn mmap_bench(path: &Path) { let file = OpenOptions::new() .read(true) .write(true) + .truncate(true) .create(true) .open(path) .unwrap(); diff --git a/benches/userspace_cache_benchmark.rs b/benches/userspace_cache_benchmark.rs index 95ebd1cb..a1335586 100644 --- a/benches/userspace_cache_benchmark.rs +++ b/benches/userspace_cache_benchmark.rs @@ -111,6 +111,7 @@ mod unix { let file = OpenOptions::new() .read(true) .write(true) + .truncate(true) .create(true) .open(path) .unwrap(); @@ -350,6 +351,7 @@ mod unix { let file = OpenOptions::new() .read(true) .write(true) + .truncate(true) .create(true) .open(path) .unwrap(); diff --git a/examples/special_values.rs b/examples/special_values.rs index 9b5a1092..b4191339 100644 --- a/examples/special_values.rs +++ b/examples/special_values.rs @@ -19,6 +19,7 @@ impl SpecialValuesDb { database: Database::create("index.redb").unwrap(), file: OpenOptions::new() .write(true) + .truncate(true) .create(true) .read(true) .open("values.dat") diff --git a/rust-toolchain b/rust-toolchain index 9cf4011b..ea3769f2 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.66 +1.81 diff --git a/src/transactions.rs b/src/transactions.rs index 6f59dada..cf3af733 100644 --- a/src/transactions.rs +++ b/src/transactions.rs @@ -181,6 +181,7 @@ pub enum Durability { /// 2. can introduce crashes during fsync(), /// 3. has knowledge of the database file contents, and /// 4. can include arbitrary data in a write transaction + /// /// could cause a transaction to partially commit (some but not all of the data is written). /// This is described in the design doc in futher detail. /// diff --git a/src/tree_store/page_store/header.rs b/src/tree_store/page_store/header.rs index cd4be9d5..40b67a88 100644 --- a/src/tree_store/page_store/header.rs +++ b/src/tree_store/page_store/header.rs @@ -654,7 +654,10 @@ mod test { // IETF Memo "Care and Feeding of Magic Numbers" // Test that magic number is not valid utf-8 - assert!(std::str::from_utf8(&MAGICNUMBER).is_err()); + #[allow(invalid_from_utf8)] + { + assert!(std::str::from_utf8(&MAGICNUMBER).is_err()); + } // Test there is a octet with high-bit set assert!(MAGICNUMBER.iter().any(|x| *x & 0x80 != 0)); // Test there is a non-printable ASCII character diff --git a/tests/basic_tests.rs b/tests/basic_tests.rs index 8a0c1d60..99f96788 100644 --- a/tests/basic_tests.rs +++ b/tests/basic_tests.rs @@ -190,7 +190,7 @@ fn extract_if() { let mut table = write_txn.open_table(U64_TABLE).unwrap(); assert_eq!(table.len().unwrap(), 10); for _ in table.extract_if(|x, _| x % 2 != 0).unwrap() {} - table.extract_if(|_, _| true).unwrap().rev().next(); + table.extract_if(|_, _| true).unwrap().next_back(); } write_txn.commit().unwrap();