diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-02-20 01:02:15 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-02-20 01:02:15 +0100 |
| commit | e8474426d8c0ca60ac222845b9c6f7befe3f6a4a (patch) | |
| tree | 2a530bf325e59bce63ccad1ee99e0c5c90df9418 /docs | |
| parent | 69bfcaad42e560b3d52c0e03a761dcedf34cc09f (diff) | |
hal-internal: remove impl DerefMut for PeripheralRef.
if you have `PeripheralRef<'a, AnyPIn>` for pin A, and `AnyPin` (owned) for pin B, you can `mem::swap` them.
so, getting access forever to pin A, just by "sacrificing" pin B
this defeats the point of PeripheralRef, which is if you got a `PeripheralRef<'a, T>` then you're only allowed to use the peripheral for `'a`.
Also some drivers rely on the fact only one instance of a singleton exists for soundness, so this is a soundness fix for those.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
