remove the Mutex.borrow_mut
because it can be used to bypass Rust's borrow checker
``` rust
static FOO: Mutex<bool> = Mutex::new(false);
fn main() {
cortex_m::interrupt::free(|mut cs1| {
cortex_m::interrupt::free(|mut cs2| {
let foo = FOO.borrow_mut(&mut cs1);
let and_foo = FOO.borrow_mut(&mut cs2);
});
});
}
```
@@ -19,14 +19,6 @@ impl<T> Mutex<T> {
pub fn borrow<'cs>(&self, _ctxt: &'cs CriticalSection) -> &'cs T {
unsafe { &*self.inner.get() }
}
-
- /// Mutably borrows the data for the duration of the critical section
- pub fn borrow_mut<'cs>(
- &self,
- _ctxt: &'cs mut CriticalSection,
- ) -> &'cs mut T {
- unsafe { &mut *self.inner.get() }
- }
}
/// Interrupt number
