(&mut self)
| 21 | struct Wrapper<'a>(&'a mut [u8]); |
| 22 | impl<'a> Wrapper<'a> { |
| 23 | fn read(&mut self) { |
| 24 | // Ideally we'd write this, but it gets: |
| 25 | // "cannot move out of `self` which is behind a mutable reference". |
| 26 | /* |
| 27 | read(self.0); |
| 28 | */ |
| 29 | |
| 30 | // The fix: add `&mut *`. |
| 31 | read(&mut *self.0); |
| 32 | } |
| 33 | } |
| 34 | let mut buf = vec![0_u8; 3]; |
| 35 | let mut wrapper = Wrapper(&mut buf); |
no test coverage detected