]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/borrowck-call-method-from-mut-aliasable.rs
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / borrowck-call-method-from-mut-aliasable.rs
1 struct Foo {
2     x: isize,
3 }
4
5 impl Foo {
6     pub fn f(&self) {}
7     pub fn h(&mut self) {}
8 }
9
10 fn a(x: &mut Foo) {
11     x.f();
12     x.h();
13 }
14
15 fn b(x: &Foo) {
16     x.f();
17     x.h(); //~ ERROR cannot borrow
18 }
19
20 fn main() {
21 }