2012-09-11 23:25:01 -05:00
|
|
|
struct Foo {
|
2015-01-08 04:54:35 -06:00
|
|
|
x: isize,
|
2012-09-11 23:25:01 -05:00
|
|
|
}
|
|
|
|
|
2013-05-31 17:17:22 -05:00
|
|
|
impl Foo {
|
|
|
|
pub fn f(&self) {}
|
|
|
|
pub fn h(&mut self) {}
|
2012-09-11 23:25:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn a(x: &mut Foo) {
|
2013-01-23 20:15:06 -06:00
|
|
|
x.f();
|
2012-09-11 23:25:01 -05:00
|
|
|
x.h();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn b(x: &Foo) {
|
|
|
|
x.f();
|
2013-03-15 14:24:24 -05:00
|
|
|
x.h(); //~ ERROR cannot borrow
|
2012-09-11 23:25:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|