2020-06-03 01:38:34 -04:00
|
|
|
error[E0597]: `scope2` does not live long enough
|
2023-07-11 14:50:03 -04:00
|
|
|
--> tests/compile_fail/boxed_local.rs:9:43
|
2020-02-12 17:45:14 -05:00
|
|
|
|
|
2021-10-27 08:32:12 -04:00
|
|
|
7 | let _boxed_local = {
|
2020-02-12 18:20:24 -05:00
|
|
|
| ------------ borrow later stored here
|
2021-10-27 08:32:12 -04:00
|
|
|
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
2023-07-11 14:50:03 -04:00
|
|
|
| ---------- binding `scope2` declared here
|
2021-10-27 08:32:12 -04:00
|
|
|
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
2020-06-03 01:38:34 -04:00
|
|
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
2021-10-27 08:32:12 -04:00
|
|
|
10 | Box::new(v8::Integer::new(&mut scope3, 123))
|
|
|
|
11 | };
|
2020-06-03 01:38:34 -04:00
|
|
|
| - `scope2` dropped here while still borrowed
|