File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
1
error[E0521]: borrowed data escapes outside of closure
2
- --> tests/async_compile_fail/async_nested_contexts.rs:11:38
2
+ --> tests/async_compile_fail/async_nested_contexts.rs:11:13
3
3
|
4
4
7 | / async_with!(ctx_1 => |ctx_1|{
5
5
8 | |/ async_with!(ctx_2 => |ctx_2|{
6
6
9 | || // It is disallowed to use multiple ctx object together from different with closures.
7
7
10 | || // Lifetime on ctx should be unique.
8
8
11 | || ctx_1.globals().set("t", ctx_2.globals());
9
- | || ^^^^^^^^^^^^^^^ `ctx_2` escapes the closure body here
9
+ | || ^^^^^^^^^^^^^^^ `ctx_2` escapes the closure body here
10
10
12 | || }).await
11
11
| ||__________- `ctx_2` is a reference that is only valid in the closure body
12
12
13 | | })
13
13
| |_______- `ctx_1` declared here, outside of the closure body
14
14
15
15
error[E0521]: borrowed data escapes outside of closure
16
- --> tests/async_compile_fail/async_nested_contexts.rs:11:13
16
+ --> tests/async_compile_fail/async_nested_contexts.rs:11:38
17
17
|
18
18
7 | / async_with!(ctx_1 => |ctx_1|{
19
19
8 | | async_with!(ctx_2 => |ctx_2|{
20
20
... |
21
21
11 | | ctx_1.globals().set("t", ctx_2.globals());
22
- | | ^^^^^^^^^^^^^^^
23
- | | |
24
- | | `ctx_1` escapes the closure body here
25
- | | argument requires that `'1` must outlive `'static`
22
+ | | ^^^^^^^^^^^^^^^
23
+ | | |
24
+ | | `ctx_1` escapes the closure body here
25
+ | | argument requires that `'1` must outlive `'static`
26
26
12 | | }).await
27
27
13 | | })
28
28
| | -
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ error[E0597]: `var` does not live long enough
7
7
| ^^^^^^^^ borrowed value does not live long enough
8
8
...
9
9
13 | ctx.globals().set("t",func).unwrap();
10
- | --------------------------- argument requires that `var` is borrowed for `'static`
10
+ | ------------- argument requires that `var` is borrowed for `'static`
11
11
...
12
12
16 | }
13
13
| - `var` dropped here while still borrowed
Original file line number Diff line number Diff line change 1
1
error[E0521]: borrowed data escapes outside of closure
2
- --> tests/compile_fail/nested_contexts.rs:9:38
2
+ --> tests/compile_fail/nested_contexts.rs:9:13
3
3
|
4
4
7 | ctx_1.with(|ctx_1| {
5
5
| ----- `ctx_1` declared here, outside of the closure body
6
6
8 | ctx_2.with(|ctx_2| {
7
7
| ----- `ctx_2` is a reference that is only valid in the closure body
8
8
9 | ctx_1.globals().set("t", ctx_2.globals());
9
- | ^^^^^^^^^^^^^^^ `ctx_2` escapes the closure body here
9
+ | ^^^^^^^^^^^^^^^ `ctx_2` escapes the closure body here
10
10
|
11
11
= note: requirement occurs because of the type `Ctx<'_>`, which makes the generic argument `'_` invariant
12
12
= note: the struct `Ctx<'js>` is invariant over the parameter `'js`
13
13
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
14
14
15
15
error[E0521]: borrowed data escapes outside of closure
16
- --> tests/compile_fail/nested_contexts.rs:9:13
16
+ --> tests/compile_fail/nested_contexts.rs:9:38
17
17
|
18
18
7 | ctx_1.with(|ctx_1| {
19
19
| -----
@@ -22,7 +22,7 @@ error[E0521]: borrowed data escapes outside of closure
22
22
| has type `Ctx<'1>`
23
23
8 | ctx_2.with(|ctx_2| {
24
24
9 | ctx_1.globals().set("t", ctx_2.globals());
25
- | ^^^^^^^^^^^^^^^
26
- | |
27
- | `ctx_1` escapes the closure body here
28
- | argument requires that `'1` must outlive `'static`
25
+ | ^^^^^^^^^^^^^^^
26
+ | |
27
+ | `ctx_1` escapes the closure body here
28
+ | argument requires that `'1` must outlive `'static`
You can’t perform that action at this time.
0 commit comments