2020-01-19 21:16:37 -05:00
|
|
|
error[E0499]: cannot borrow `*root_hs` as mutable more than once at a time
|
|
|
|
--> $DIR/handle_scope_lifetimes.rs:12:47
|
2019-12-24 18:31:36 -05:00
|
|
|
|
|
2020-01-19 21:16:37 -05:00
|
|
|
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);
|
2019-12-24 18:31:36 -05:00
|
|
|
| -- first borrow later used here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `*hs1` as mutable more than once at a time
|
2020-01-19 21:16:37 -05:00
|
|
|
--> $DIR/handle_scope_lifetimes.rs:23:34
|
2019-12-24 18:31:36 -05:00
|
|
|
|
|
2020-01-19 21:16:37 -05:00
|
|
|
21 | let mut hs2 = v8::EscapableHandleScope::new(hs1);
|
2019-12-24 18:31:36 -05:00
|
|
|
| --- first mutable borrow occurs here
|
2020-01-19 21:16:37 -05:00
|
|
|
22 | let hs2 = hs2.enter();
|
|
|
|
23 | let _fail = v8::Integer::new(hs1, 123);
|
2019-12-24 18:31:36 -05:00
|
|
|
| ^^^ second mutable borrow occurs here
|
2020-01-19 21:16:37 -05:00
|
|
|
24 | let _local2 = v8::Integer::new(hs2, 123);
|
2019-12-24 18:31:36 -05:00
|
|
|
| --- first borrow later used here
|
|
|
|
|
|
|
|
error[E0597]: `hs` does not live long enough
|
2020-01-19 21:16:37 -05:00
|
|
|
--> $DIR/handle_scope_lifetimes.rs:30:14
|
2019-12-24 18:31:36 -05:00
|
|
|
|
|
2020-01-19 21:16:37 -05:00
|
|
|
28 | let _leak1 = {
|
2019-12-24 18:31:36 -05:00
|
|
|
| ------ borrow later stored here
|
2020-01-19 21:16:37 -05:00
|
|
|
29 | let mut hs = v8::EscapableHandleScope::new(root_hs);
|
|
|
|
30 | let hs = hs.enter();
|
2019-12-24 18:31:36 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
2020-01-19 21:16:37 -05:00
|
|
|
31 | v8::Integer::new(hs, 456)
|
|
|
|
32 | };
|
2019-12-24 18:31:36 -05:00
|
|
|
| - `hs` dropped here while still borrowed
|
|
|
|
|
|
|
|
error[E0597]: `hs` does not live long enough
|
2020-01-19 21:16:37 -05:00
|
|
|
--> $DIR/handle_scope_lifetimes.rs:36:5
|
2019-12-24 18:31:36 -05:00
|
|
|
|
|
2020-01-19 21:16:37 -05:00
|
|
|
36 | hs.enter()
|
2019-12-24 18:31:36 -05:00
|
|
|
| ^^--------
|
|
|
|
| |
|
|
|
|
| borrowed value does not live long enough
|
|
|
|
| borrow later used here
|
2020-01-19 21:16:37 -05:00
|
|
|
37 | };
|
2019-12-24 18:31:36 -05:00
|
|
|
| - `hs` dropped here while still borrowed
|