Skip to content

Commit 3394aa3

Browse files
authored
Fix compile tests (#451)
1 parent 54a3ee7 commit 3394aa3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

tests/async_compile_fail/async_nested_contexts.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
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
33
|
44
7 | / async_with!(ctx_1 => |ctx_1|{
55
8 | |/ async_with!(ctx_2 => |ctx_2|{
66
9 | || // It is disallowed to use multiple ctx object together from different with closures.
77
10 | || // Lifetime on ctx should be unique.
88
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
1010
12 | || }).await
1111
| ||__________- `ctx_2` is a reference that is only valid in the closure body
1212
13 | | })
1313
| |_______- `ctx_1` declared here, outside of the closure body
1414

1515
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
1717
|
1818
7 | / async_with!(ctx_1 => |ctx_1|{
1919
8 | | async_with!(ctx_2 => |ctx_2|{
2020
... |
2121
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`
2626
12 | | }).await
2727
13 | | })
2828
| | -

tests/async_compile_fail/captured_variable_spawn.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ error[E0597]: `var` does not live long enough
77
| ^^^^^^^^ borrowed value does not live long enough
88
...
99
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`
1111
...
1212
16 | }
1313
| - `var` dropped here while still borrowed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
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
33
|
44
7 | ctx_1.with(|ctx_1| {
55
| ----- `ctx_1` declared here, outside of the closure body
66
8 | ctx_2.with(|ctx_2| {
77
| ----- `ctx_2` is a reference that is only valid in the closure body
88
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
1010
|
1111
= note: requirement occurs because of the type `Ctx<'_>`, which makes the generic argument `'_` invariant
1212
= note: the struct `Ctx<'js>` is invariant over the parameter `'js`
1313
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1414

1515
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
1717
|
1818
7 | ctx_1.with(|ctx_1| {
1919
| -----
@@ -22,7 +22,7 @@ error[E0521]: borrowed data escapes outside of closure
2222
| has type `Ctx<'1>`
2323
8 | ctx_2.with(|ctx_2| {
2424
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`

0 commit comments

Comments
 (0)