rust/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.stderr

27 lines
977 B
Plaintext
Raw Normal View History

2020-11-25 14:15:55 -06:00
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/multilevel-path.rs:4:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0499]: cannot borrow `w.p.x` as mutable more than once at a time
--> $DIR/multilevel-path.rs:23:14
|
LL | let mut c = || {
| -- first mutable borrow occurs here
LL | w.p.x += 20;
| ----- first borrow occurs due to use of `w.p.x` in closure
2020-11-25 14:15:55 -06:00
...
LL | let py = &mut w.p.x;
| ^^^^^^^^^^ second mutable borrow occurs here
LL |
LL | c();
| - first borrow later used here
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0499`.