Skip to content

Commit

Permalink
Update rust toolchain to 1.70.0 (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
widagdos committed Apr 25, 2024
1 parent b6ebe50 commit b7f2f3b
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: RocksDB CI

on: [push, pull_request]
env:
RUST_VERSION: 1.66.0
RUST_VERSION: 1.70.0

jobs:
fmt:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion librocksdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 1 addition & 4 deletions src/prop_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions tests/fail/checkpoint_outlive_db.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 | };
Expand Down
1 change: 1 addition & 0 deletions tests/fail/iterator_outlive_db.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 | };
Expand Down
16 changes: 10 additions & 6 deletions tests/fail/open_with_multiple_refs_as_single_threaded.stderr
Original file line number Diff line number Diff line change
@@ -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;
| ~~~~~~~
1 change: 1 addition & 0 deletions tests/fail/snapshot_outlive_db.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 | };
Expand Down
1 change: 1 addition & 0 deletions tests/fail/snapshot_outlive_transaction.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 | };
Expand Down
1 change: 1 addition & 0 deletions tests/fail/snapshot_outlive_transaction_db.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 | };
Expand Down
1 change: 1 addition & 0 deletions tests/fail/transaction_outlive_transaction_db.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 | };
Expand Down

0 comments on commit b7f2f3b

Please sign in to comment.