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