summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs
blob: 6b5544a8a396ba5d9aca5ef46313d04e3b0e5c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct A;

impl A {
    fn foo(&mut self) {
    }
}



pub fn main() {
    let a: Box<_> = Box::new(A);
    a.foo();
    //~^ ERROR cannot borrow `*a` as mutable, as `a` is not declared as mutable [E0596]
}