2014-06-21 00:08:58 -05:00
|
|
|
struct A;
|
|
|
|
|
|
|
|
impl A {
|
|
|
|
fn foo(&mut self) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-24 19:39:40 -05:00
|
|
|
|
|
|
|
|
2014-06-21 00:08:58 -05:00
|
|
|
pub fn main() {
|
2021-08-24 19:39:40 -05:00
|
|
|
let a: Box<_> = Box::new(A);
|
2014-06-21 00:08:58 -05:00
|
|
|
a.foo();
|
2019-04-22 02:40:08 -05:00
|
|
|
//~^ ERROR cannot borrow `*a` as mutable, as `a` is not declared as mutable [E0596]
|
2014-06-21 00:08:58 -05:00
|
|
|
}
|