]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/borrowed-referent-issue-38899.stderr
Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee
[rust.git] / src / test / ui / nll / borrowed-referent-issue-38899.stderr
1 error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
2   --> $DIR/borrowed-referent-issue-38899.rs:11:21
3    |
4 LL |     let x = &mut block;
5    |             ---------- mutable borrow occurs here
6 LL |     println!("{}", x.current);
7 LL |     let p: &'a u8 = &*block.current;
8    |                     ^^^^^^^^^^^^^^^ immutable borrow occurs here
9 LL |
10 LL |     drop(x);
11    |          - mutable borrow later used here
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0502`.