forked from rust-rocksdb/rust-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix some test error(still failed to pass test)
- Loading branch information
1 parent
01ab281
commit 179fd37
Showing
11 changed files
with
40 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
|
||
use rocksdb::{DB, checkpoint::Checkpoint}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/checkpoint_outlive_db.rs:6:25 | ||
--> tests/fail/checkpoint_outlive_db.rs:8:25 | ||
| | ||
4 | let _checkpoint = { | ||
6 | let _checkpoint = { | ||
| ----------- borrow later stored here | ||
5 | let db = DB::open_default("foo").unwrap(); | ||
6 | Checkpoint::new(&db) | ||
7 | let db = DB::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
8 | Checkpoint::new(&db) | ||
| ^^^ borrowed value does not live long enough | ||
7 | }; | ||
9 | }; | ||
| - `db` dropped here while still borrowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
use rocksdb::{IteratorMode, DB}; | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/iterator_outlive_db.rs:6:9 | ||
--> tests/fail/iterator_outlive_db.rs:7:9 | ||
| | ||
4 | let _iter = { | ||
5 | let _iter = { | ||
| ----- borrow later stored here | ||
5 | let db = DB::open_default("foo").unwrap(); | ||
6 | db.iterator(IteratorMode::Start) | ||
6 | let db = DB::open_default("foo").unwrap(); | ||
| -- binding `db` declared here | ||
7 | db.iterator(IteratorMode::Start) | ||
| ^^ borrowed value does not live long enough | ||
7 | }; | ||
8 | }; | ||
| - `db` dropped here while still borrowed |
20 changes: 4 additions & 16 deletions
20
tests/fail/open_with_multiple_refs_as_single_threaded.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
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 | ||
error[E0432]: unresolved import `rocksdb` | ||
--> tests/fail/open_with_multiple_refs_as_single_threaded.rs:1: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 | ||
|
||
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 | ||
1 | use rocksdb::{SingleThreaded, DBWithThreadMode, Options}; | ||
| ^^^^^^^ use of undeclared crate or module `rocksdb` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
error[E0597]: `db` does not live long enough | ||
--> tests/fail/snapshot_outlive_db.rs:6:9 | ||
error[E0432]: unresolved import `rocksdb` | ||
--> tests/fail/snapshot_outlive_db.rs:1:5 | ||
| | ||
4 | let _snapshot = { | ||
| --------- borrow later stored here | ||
5 | let db = DB::open_default("foo").unwrap(); | ||
6 | db.snapshot() | ||
| ^^ borrowed value does not live long enough | ||
7 | }; | ||
| - `db` dropped here while still borrowed | ||
1 | use rocksdb::DB; | ||
| ^^^^^^^ use of undeclared crate or module `rocksdb` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use haizhi_rocksdb as rocksdb; | ||
|
||
use rocksdb::{Options, DB}; | ||
use std::cmp::Ordering; | ||
use std::iter::FromIterator; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters