]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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 }