]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/issue-51268.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / issue-51268.stderr
1 error[E0502]: cannot borrow `self.thing` as mutable because it is also borrowed as immutable
2   --> $DIR/issue-51268.rs:14:9
3    |
4 LL |           self.thing.bar(|| {
5    |           ^          --- -- immutable borrow occurs here
6    |           |          |
7    |  _________|          immutable borrow later used by call
8    | |
9 LL | |
10 LL | |             &self.number;
11    | |              ----------- first borrow occurs due to use of `self` in closure
12 LL | |         });
13    | |__________^ mutable borrow occurs here
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0502`.