summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWidagdo Setiawan <widagdos@gmail.com>2024-04-25 04:10:35 -0700
committerGitHub <noreply@github.com>2024-04-25 15:10:35 +0400
commitb7f2f3be3c6c2cda767d619b3faf4bd7abe955fc (patch)
tree1f0e6fa3a15f34caf453b9b3cd2966968ae3634a
parentb6ebe50e7d7e199345a405ef00d1ed13ddf3d342 (diff)
Update rust toolchain to 1.70.0 (#874)
-rw-r--r--.github/workflows/rust.yml2
-rw-r--r--Cargo.toml2
-rw-r--r--README.md2
-rw-r--r--librocksdb-sys/Cargo.toml2
-rw-r--r--src/prop_name.rs5
-rw-r--r--tests/fail/checkpoint_outlive_db.stderr1
-rw-r--r--tests/fail/iterator_outlive_db.stderr1
-rw-r--r--tests/fail/open_with_multiple_refs_as_single_threaded.stderr16
-rw-r--r--tests/fail/snapshot_outlive_db.stderr1
-rw-r--r--tests/fail/snapshot_outlive_transaction.stderr1
-rw-r--r--tests/fail/snapshot_outlive_transaction_db.stderr1
-rw-r--r--tests/fail/transaction_outlive_transaction_db.stderr1
12 files changed, 21 insertions, 14 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 260c673..36da02d 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -2,7 +2,7 @@ name: RocksDB CI
on: [push, pull_request]
env:
- RUST_VERSION: 1.66.0
+ RUST_VERSION: 1.70.0
jobs:
fmt:
diff --git a/Cargo.toml b/Cargo.toml
index f7a0d22..bbbb2eb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ name = "rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database"
version = "0.22.0"
edition = "2018"
-rust-version = "1.66.0"
+rust-version = "1.70.0"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
license = "Apache-2.0"
diff --git a/README.md b/README.md
index df58eb1..87ab17f 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[![documentation](https://docs.rs/rocksdb/badge.svg)](https://docs.rs/rocksdb)
[![license](https://img.shields.io/crates/l/rocksdb.svg)](https://github.com/rust-rocksdb/rust-rocksdb/blob/master/LICENSE)
[![Gitter chat](https://badges.gitter.im/rust-rocksdb/gitter.svg)](https://gitter.im/rust-rocksdb/lobby)
-![rust 1.66.0 required](https://img.shields.io/badge/rust-1.66.0-blue.svg?label=MSRV)
+![rust 1.70.0 required](https://img.shields.io/badge/rust-1.70.0-blue.svg?label=MSRV)
![GitHub commits (since latest release)](https://img.shields.io/github/commits-since/rust-rocksdb/rust-rocksdb/latest.svg)
diff --git a/librocksdb-sys/Cargo.toml b/librocksdb-sys/Cargo.toml
index d15746b..5bb6807 100644
--- a/librocksdb-sys/Cargo.toml
+++ b/librocksdb-sys/Cargo.toml
@@ -2,7 +2,7 @@
name = "librocksdb-sys"
version = "0.17.0+9.0.0"
edition = "2018"
-rust-version = "1.66.0"
+rust-version = "1.70.0"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
description = "Native bindings to librocksdb"
diff --git a/src/prop_name.rs b/src/prop_name.rs
index 0c8f717..8f1c046 100644
--- a/src/prop_name.rs
+++ b/src/prop_name.rs
@@ -17,12 +17,9 @@ impl PropName {
/// Panics if the `value` isn’t terminated by a nul byte or contains
/// interior nul bytes.
pub(crate) const fn new_unwrap(value: &str) -> &Self {
- let bytes = if let Some((&0, bytes)) = value.as_bytes().split_last() {
- bytes
- } else {
+ let Some((&0, bytes)) = value.as_bytes().split_last() else {
panic!("input was not nul-terminated");
};
-
let mut idx = 0;
while idx < bytes.len() {
assert!(bytes[idx] != 0, "input contained interior nul byte");
diff --git a/tests/fail/checkpoint_outlive_db.stderr b/tests/fail/checkpoint_outlive_db.stderr
index a8ff0cc..6d16fa8 100644
--- a/tests/fail/checkpoint_outlive_db.stderr
+++ b/tests/fail/checkpoint_outlive_db.stderr
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
4 | let _checkpoint = {
| ----------- borrow later stored here
5 | let db = DB::open_default("foo").unwrap();
+ | -- binding `db` declared here
6 | Checkpoint::new(&db)
| ^^^ borrowed value does not live long enough
7 | };
diff --git a/tests/fail/iterator_outlive_db.stderr b/tests/fail/iterator_outlive_db.stderr
index 9fbaf15..3eb3085 100644
--- a/tests/fail/iterator_outlive_db.stderr
+++ b/tests/fail/iterator_outlive_db.stderr
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
4 | let _iter = {
| ----- borrow later stored here
5 | let db = DB::open_default("foo").unwrap();
+ | -- binding `db` declared here
6 | db.iterator(IteratorMode::Start)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
7 | };
diff --git a/tests/fail/open_with_multiple_refs_as_single_threaded.stderr b/tests/fail/open_with_multiple_refs_as_single_threaded.stderr
index 0f17e9d..984ef88 100644
--- a/tests/fail/open_with_multiple_refs_as_single_threaded.stderr
+++ b/tests/fail/open_with_multiple_refs_as_single_threaded.stderr
@@ -1,17 +1,21 @@
error[E0596]: cannot borrow `*db_ref1` as mutable, as it is behind a `&` reference
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:8:5
|
-5 | let db_ref1 = &db;
- | --- help: consider changing this to be a mutable reference: `&mut db`
-...
8 | db_ref1.create_cf("cf1", &opts).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `db_ref1` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ |
+help: consider changing this to be a mutable reference
+ |
+5 | let db_ref1 = &mut db;
+ | ~~~~~~~
error[E0596]: cannot borrow `*db_ref2` as mutable, as it is behind a `&` reference
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:9:5
|
-6 | let db_ref2 = &db;
- | --- help: consider changing this to be a mutable reference: `&mut db`
-...
9 | db_ref2.create_cf("cf2", &opts).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `db_ref2` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ |
+help: consider changing this to be a mutable reference
+ |
+6 | let db_ref2 = &mut db;
+ | ~~~~~~~
diff --git a/tests/fail/snapshot_outlive_db.stderr b/tests/fail/snapshot_outlive_db.stderr
index e0ae012..05fbc56 100644
--- a/tests/fail/snapshot_outlive_db.stderr
+++ b/tests/fail/snapshot_outlive_db.stderr
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
4 | let _snapshot = {
| --------- borrow later stored here
5 | let db = DB::open_default("foo").unwrap();
+ | -- binding `db` declared here
6 | db.snapshot()
| ^^^^^^^^^^^^^ borrowed value does not live long enough
7 | };
diff --git a/tests/fail/snapshot_outlive_transaction.stderr b/tests/fail/snapshot_outlive_transaction.stderr
index 653c1a8..9f5305b 100644
--- a/tests/fail/snapshot_outlive_transaction.stderr
+++ b/tests/fail/snapshot_outlive_transaction.stderr
@@ -4,6 +4,7 @@ error[E0597]: `txn` does not live long enough
5 | let _snapshot = {
| --------- borrow later stored here
6 | let txn = db.transaction();
+ | --- binding `txn` declared here
7 | txn.snapshot()
| ^^^^^^^^^^^^^^ borrowed value does not live long enough
8 | };
diff --git a/tests/fail/snapshot_outlive_transaction_db.stderr b/tests/fail/snapshot_outlive_transaction_db.stderr
index d07341f..a9721b6 100644
--- a/tests/fail/snapshot_outlive_transaction_db.stderr
+++ b/tests/fail/snapshot_outlive_transaction_db.stderr
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
4 | let _snapshot = {
| --------- borrow later stored here
5 | let db = TransactionDB::<SingleThreaded>::open_default("foo").unwrap();
+ | -- binding `db` declared here
6 | db.snapshot()
| ^^^^^^^^^^^^^ borrowed value does not live long enough
7 | };
diff --git a/tests/fail/transaction_outlive_transaction_db.stderr b/tests/fail/transaction_outlive_transaction_db.stderr
index 45237a3..8a8d343 100644
--- a/tests/fail/transaction_outlive_transaction_db.stderr
+++ b/tests/fail/transaction_outlive_transaction_db.stderr
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
4 | let _txn = {
| ---- borrow later stored here
5 | let db = TransactionDB::<SingleThreaded>::open_default("foo").unwrap();
+ | -- binding `db` declared here
6 | db.transaction()
| ^^^^^^^^^^^^^^^^ borrowed value does not live long enough
7 | };