]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/two-phase-method-receivers.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / borrowck / two-phase-method-receivers.rs
1 // compile-flags: -Z borrowck=mir -Z two-phase-borrows
2
3 // run-pass
4
5 struct Foo<'a> {
6     x: &'a i32
7 }
8
9 impl<'a> Foo<'a> {
10     fn method(&mut self, _: &i32) {
11     }
12 }
13
14 fn main() {
15     let a = &mut Foo { x: &22 };
16     Foo::method(a, a.x);
17 }