mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-12-25 08:39:15 -05:00
44 lines
1.8 KiB
Text
44 lines
1.8 KiB
Text
error[E0499]: cannot borrow `*root_hs` as mutable more than once at a time
|
|
--> $DIR/handle_scope_lifetimes.rs:12:47
|
|
|
|
|
10 | let mut hs = v8::EscapableHandleScope::new(root_hs);
|
|
| ------- first mutable borrow occurs here
|
|
11 | let hs = hs.enter();
|
|
12 | let _fail = v8::EscapableHandleScope::new(root_hs);
|
|
| ^^^^^^^ second mutable borrow occurs here
|
|
13 | let _local = v8::Integer::new(hs, 123);
|
|
| -- first borrow later used here
|
|
|
|
error[E0499]: cannot borrow `*hs1` as mutable more than once at a time
|
|
--> $DIR/handle_scope_lifetimes.rs:23:34
|
|
|
|
|
21 | let mut hs2 = v8::EscapableHandleScope::new(hs1);
|
|
| --- first mutable borrow occurs here
|
|
22 | let hs2 = hs2.enter();
|
|
23 | let _fail = v8::Integer::new(hs1, 123);
|
|
| ^^^ second mutable borrow occurs here
|
|
24 | let _local2 = v8::Integer::new(hs2, 123);
|
|
| --- first borrow later used here
|
|
|
|
error[E0597]: `hs` does not live long enough
|
|
--> $DIR/handle_scope_lifetimes.rs:30:14
|
|
|
|
|
28 | let _leak1 = {
|
|
| ------ borrow later stored here
|
|
29 | let mut hs = v8::EscapableHandleScope::new(root_hs);
|
|
30 | let hs = hs.enter();
|
|
| ^^ borrowed value does not live long enough
|
|
31 | v8::Integer::new(hs, 456)
|
|
32 | };
|
|
| - `hs` dropped here while still borrowed
|
|
|
|
error[E0597]: `hs` does not live long enough
|
|
--> $DIR/handle_scope_lifetimes.rs:36:5
|
|
|
|
|
36 | hs.enter()
|
|
| ^^--------
|
|
| |
|
|
| borrowed value does not live long enough
|
|
| borrow later used here
|
|
37 | };
|
|
| - `hs` dropped here while still borrowed
|