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