]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-51268.rs
Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-51268.rs
1 struct Bar;
2
3 impl Bar {
4     fn bar(&mut self, _: impl Fn()) {}
5 }
6
7 struct Foo {
8     thing: Bar,
9     number: usize,
10 }
11
12 impl Foo {
13     fn foo(&mut self) {
14         self.thing.bar(|| {
15         //~^ ERROR cannot borrow `self.thing` as mutable because it is also borrowed as immutable [E0502]
16             &self.number;
17         });
18     }
19 }
20
21 fn main() {}