# gpui: Remove all \(unsound\) \`ManuallyDrop\` usages, panic on device loss \(\#42114\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/bf8864d106be4f162165e44092f67e35074fbd6e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: bf8864d106be4f162165e44092f67e35074fbd6e

Requested commit: bf8864d106be4f162165e44092f67e35074fbd6e

Commit: bf8864d106be4f162165e44092f67e35074fbd6e

Tree: c3a7f7ca83cc7ac5a02b7d954bb3d1359279d590

Author: Lukas Wirth

Committer: GitHub

## Message

```
gpui: Remove all (unsound) `ManuallyDrop` usages, panic on device loss (#42114)

Given that when we lose our devices unrecoverably we will panic anyways,
might as well do so eagerly which makes it clearer.

Additionally this PR replaces all uses of `ManuallyDrop` with `Option`,
as otherwise we need to do manual bookkeeping of what is and isn't
initialized when we try to recover devices as we can bail out halfway
while recovering. In other words, the code prior to this was fairly
unsound due to freely using `ManuallyDrop::drop`.
 
Fixes ZED-1SS
 
Release Notes:

- N/A *or* Added/Fixed/Improved ...
```

## Parents

- [08ee4f7966d3c07c0c204054b5c50d554bf6d97d](https://git.cafe/gitcafe/zed/commit/08ee4f7966d3c07c0c204054b5c50d554bf6d97d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/bf8864d106be4f162165e44092f67e35074fbd6e?format=markdown)
