11 lines
408 B
Text
11 lines
408 B
Text
error[E0597]: `db` does not live long enough
|
|
--> tests/fail/snapshot_outlive_db.rs:6:9
|
|
|
|
|
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 | };
|
|
| - `db` dropped here while still borrowed
|