]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-51268.rs
use jemallocator in rustc/rustdoc
[rust.git] / src / test / ui / nll / issue-51268.rs
1 // ignore-tidy-linelength
2
3 struct Bar;
4
5 impl Bar {
6     fn bar(&mut self, _: impl Fn()) {}
7 }
8
9 struct Foo {
10     thing: Bar,
11     number: usize,
12 }
13
14 impl Foo {
15     fn foo(&mut self) {
16         self.thing.bar(|| {
17         //~^ ERROR cannot borrow `self.thing` as mutable because it is also borrowed as immutable [E0502]
18             &self.number;
19         });
20     }
21 }
22
23 fn main() {}