os-rust/src/test/ui/borrowck/borrowck-closures-two-mut.stderr

154 lines
6.4 KiB
Text
Raw Normal View History

error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:14:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| x = 4);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL | let c2 = to_fn_mut(|| x = 5);
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
2018-02-23 03:42:32 +03:00
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:26:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
2018-02-23 03:42:32 +03:00
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:34:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
2018-02-23 03:42:32 +03:00
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2018-02-23 03:42:32 +03:00
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2017-11-20 13:13:27 +01:00
...
2018-02-23 03:42:32 +03:00
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:55:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2018-02-23 03:42:32 +03:00
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2017-11-20 13:13:27 +01:00
...
2018-02-23 03:42:32 +03:00
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:14:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| x = 4);
| -- - first borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL | let c2 = to_fn_mut(|| x = 5);
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL |
LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:26:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - first borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL |
LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:34:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL | let c2 = to_fn_mut(|| set(&mut x));
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2019-03-09 15:03:44 +03:00
LL |
LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2018-02-23 03:42:32 +03:00
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2017-11-20 13:13:27 +01:00
...
LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-closures-two-mut.rs:55:24
|
2018-02-23 03:42:32 +03:00
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- - first borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
2018-02-23 03:42:32 +03:00
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
| ^^ - second borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
2017-11-20 13:13:27 +01:00
...
LL | drop((c1, c2));
| -- first borrow later used here
error: aborting due to 10 previous errors
2018-03-03 15:59:40 +01:00
For more information about this error, try `rustc --explain E0499`.