]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs
Sync portable-simd to rust-lang/portable-simd@72df4c45056a8bc0d1b3f06fdc828722177f0763
[rust.git] / src / test / ui / borrowck / borrowck-borrow-immut-deref-of-box-as-mut.rs
1 struct A;
2
3 impl A {
4     fn foo(&mut self) {
5     }
6 }
7
8
9
10 pub fn main() {
11     let a: Box<_> = Box::new(A);
12     a.foo();
13     //~^ ERROR cannot borrow `*a` as mutable, as `a` is not declared as mutable [E0596]
14 }