error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'js` due to conflicting requirements
--> $DIR/nested_contexts.rs:8:33
|
8 | let val: String = ctx_1.eval("'foo'").unwrap();
| ^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 9:20...
--> $DIR/nested_contexts.rs:9:20
|
9 | ctx_2.with(|ctx_2| {
| ____________________^
10 | | let f: Function = ctx_2.eval("x => x + 'b'").unwrap();
11 | | f.call::<_, ()>(val).unwrap();
12 | | })
| |_________^
note: ...but the lifetime must also be valid for the anonymous lifetime #2 defined on the body at 7:16...
--> $DIR/nested_contexts.rs:7:16
|
7 | ctx_1.with(|ctx_1| {
| ________________^
8 | | let val: String = ctx_1.eval("'foo'").unwrap();
9 | | ctx_2.with(|ctx_2| {
10 | | let f: Function = ctx_2.eval("x => x + 'b'").unwrap();
11 | | f.call::<_, ()>(val).unwrap();
12 | | })
13 | | })
| |_____^
note: ...so that the types are compatible
--> $DIR/nested_contexts.rs:10:37
|
10 | let f: Function = ctx_2.eval("x => x + 'b'").unwrap();
| ^^^^
= note: expected `Ctx<'_>`
found `Ctx<'_>`