Skip to content

Commit b7f2f3b

Browse files
authored
Update rust toolchain to 1.70.0 (rust-rocksdb#874)
1 parent b6ebe50 commit b7f2f3b

12 files changed

+21
-14
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: RocksDB CI
22

33
on: [push, pull_request]
44
env:
5-
RUST_VERSION: 1.66.0
5+
RUST_VERSION: 1.70.0
66

77
jobs:
88
fmt:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "rocksdb"
33
description = "Rust wrapper for Facebook's RocksDB embeddable database"
44
version = "0.22.0"
55
edition = "2018"
6-
rust-version = "1.66.0"
6+
rust-version = "1.70.0"
77
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
88
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
99
license = "Apache-2.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![documentation](https://docs.rs/rocksdb/badge.svg)](https://docs.rs/rocksdb)
66
[![license](https://img.shields.io/crates/l/rocksdb.svg)](https://github.com/rust-rocksdb/rust-rocksdb/blob/master/LICENSE)
77
[![Gitter chat](https://badges.gitter.im/rust-rocksdb/gitter.svg)](https://gitter.im/rust-rocksdb/lobby)
8-
![rust 1.66.0 required](https://img.shields.io/badge/rust-1.66.0-blue.svg?label=MSRV)
8+
![rust 1.70.0 required](https://img.shields.io/badge/rust-1.70.0-blue.svg?label=MSRV)
99

1010
![GitHub commits (since latest release)](https://img.shields.io/github/commits-since/rust-rocksdb/rust-rocksdb/latest.svg)
1111

librocksdb-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "librocksdb-sys"
33
version = "0.17.0+9.0.0"
44
edition = "2018"
5-
rust-version = "1.66.0"
5+
rust-version = "1.70.0"
66
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
77
license = "MIT/Apache-2.0/BSD-3-Clause"
88
description = "Native bindings to librocksdb"

src/prop_name.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ impl PropName {
1717
/// Panics if the `value` isn’t terminated by a nul byte or contains
1818
/// interior nul bytes.
1919
pub(crate) const fn new_unwrap(value: &str) -> &Self {
20-
let bytes = if let Some((&0, bytes)) = value.as_bytes().split_last() {
21-
bytes
22-
} else {
20+
let Some((&0, bytes)) = value.as_bytes().split_last() else {
2321
panic!("input was not nul-terminated");
2422
};
25-
2623
let mut idx = 0;
2724
while idx < bytes.len() {
2825
assert!(bytes[idx] != 0, "input contained interior nul byte");

tests/fail/checkpoint_outlive_db.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
44
4 | let _checkpoint = {
55
| ----------- borrow later stored here
66
5 | let db = DB::open_default("foo").unwrap();
7+
| -- binding `db` declared here
78
6 | Checkpoint::new(&db)
89
| ^^^ borrowed value does not live long enough
910
7 | };

tests/fail/iterator_outlive_db.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
44
4 | let _iter = {
55
| ----- borrow later stored here
66
5 | let db = DB::open_default("foo").unwrap();
7+
| -- binding `db` declared here
78
6 | db.iterator(IteratorMode::Start)
89
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
910
7 | };
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
error[E0596]: cannot borrow `*db_ref1` as mutable, as it is behind a `&` reference
22
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:8:5
33
|
4-
5 | let db_ref1 = &db;
5-
| --- help: consider changing this to be a mutable reference: `&mut db`
6-
...
74
8 | db_ref1.create_cf("cf1", &opts).unwrap();
85
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `db_ref1` is a `&` reference, so the data it refers to cannot be borrowed as mutable
6+
|
7+
help: consider changing this to be a mutable reference
8+
|
9+
5 | let db_ref1 = &mut db;
10+
| ~~~~~~~
911

1012
error[E0596]: cannot borrow `*db_ref2` as mutable, as it is behind a `&` reference
1113
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:9:5
1214
|
13-
6 | let db_ref2 = &db;
14-
| --- help: consider changing this to be a mutable reference: `&mut db`
15-
...
1615
9 | db_ref2.create_cf("cf2", &opts).unwrap();
1716
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `db_ref2` is a `&` reference, so the data it refers to cannot be borrowed as mutable
17+
|
18+
help: consider changing this to be a mutable reference
19+
|
20+
6 | let db_ref2 = &mut db;
21+
| ~~~~~~~

tests/fail/snapshot_outlive_db.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error[E0597]: `db` does not live long enough
44
4 | let _snapshot = {
55
| --------- borrow later stored here
66
5 | let db = DB::open_default("foo").unwrap();
7+
| -- binding `db` declared here
78
6 | db.snapshot()
89
| ^^^^^^^^^^^^^ borrowed value does not live long enough
910
7 | };

tests/fail/snapshot_outlive_transaction.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error[E0597]: `txn` does not live long enough
44
5 | let _snapshot = {
55
| --------- borrow later stored here
66
6 | let txn = db.transaction();
7+
| --- binding `txn` declared here
78
7 | txn.snapshot()
89
| ^^^^^^^^^^^^^^ borrowed value does not live long enough
910
8 | };

0 commit comments

Comments
 (0)