]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/two-phase-method-receivers.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / borrowck / two-phase-method-receivers.rs
1 // run-pass
2
3 struct Foo<'a> {
4     x: &'a i32
5 }
6
7 impl<'a> Foo<'a> {
8     fn method(&mut self, _: &i32) {
9     }
10 }
11
12 fn main() {
13     let a = &mut Foo { x: &22 };
14     Foo::method(a, a.x);
15 }