1 // This is not exactly right, yet.
3 // Ideally we should be suggesting `as_mut` for the first case,
4 // and suggesting to change `as_ref` to `as_mut` in the second.
6 fn x(cb: &mut Option<&mut dyn FnMut()>) {
8 //~^ ERROR cannot move out of `*cb` which is behind a mutable reference
11 fn x2(cb: &mut Option<&mut dyn FnMut()>) {
12 cb.as_ref().map(|cb| cb());
13 //~^ ERROR cannot borrow `*cb` as mutable, as it is behind a `&` reference