]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-11192.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-11192.stderr
1 error[E0502]: cannot borrow `*ptr` as immutable because `ptr` is also borrowed as mutable
2   --> $DIR/issue-11192.rs:30:11
3    |
4 LL |     let mut test = |foo: &Foo| {
5    |                    ----------- mutable borrow occurs here
6 LL |         println!("access {}", foo.x);
7 LL |         ptr = box Foo { x: ptr.x + 1 };
8    |         --- previous borrow occurs due to use of `ptr` in closure
9 ...
10 LL |     test(&*ptr);
11    |           ^^^^ immutable borrow occurs here
12 LL |     //~^ ERROR: cannot borrow `*ptr` as immutable
13 LL | }
14    | - mutable borrow ends here
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0502`.