diff options
author | 2017-04-08 09:30:57 -0500 | |
---|---|---|
committer | 2017-04-08 09:36:27 -0500 | |
commit | d4dec0124b961bef1f36b7da986b5d47fc9cbe15 (patch) | |
tree | 4f25e69fba4935a5bb5cc4d41ab21ba89278577a /src/lib.rs | |
parent | e16816e895c73b15a9808629576df2573d434b9a (diff) | |
download | cortex-m-d4dec0124b961bef1f36b7da986b5d47fc9cbe15.tar.gz cortex-m-d4dec0124b961bef1f36b7da986b5d47fc9cbe15.tar.zst cortex-m-d4dec0124b961bef1f36b7da986b5d47fc9cbe15.zip |
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);
});
});
}
```
Diffstat (limited to 'src/lib.rs')
0 files changed, 0 insertions, 0 deletions