]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[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 }