# gpui: Fix unreachable panic when running examples on Linux \(\#56322\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 57765207c8c1d7efc38e68e04a81d0197b523e6e

Requested commit: 57765207c8c1d7efc38e68e04a81d0197b523e6e

Commit: 57765207c8c1d7efc38e68e04a81d0197b523e6e

Tree: 4c4696f82e69ce3cba7437dae4134868b6af1052

Author: Xin Zhao

Committer: GitHub

## Message

````
gpui: Fix unreachable panic when running examples on Linux (#56322)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #56314

When running `cargo run -p gpui --example hello_world` on a wayland
linux machine, the code panics and give the following output:
```
thread 'main' (15645) panicked at crates/gpui_linux/src/linux.rs:55:14:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
and the related code is:

https://github.com/zed-industries/zed/blob/c8f09caee42ea4e27991ca55257f6f9c7d7c67d2/crates/gpui_linux/src/linux.rs#L29-L57

`gpui::guess_compositor()` correctly returns `"Wayland"`, but the
corresponding match arm is gated behind `#[cfg(feature = "wayland")]` in
`gpui_linux`, and that feature is never enabled. During the extract
gpui_platform refactor (#49277), the `wayland` and `x11` features were
added to the `zed` binary's dependency on `gpui_platform`, but were
missed in the `[dev-dependencies]` of `gpui/Cargo.toml`, which is what
the examples use.

This PR adds the missing features to the dev-dependency so that
`gpui_platform` propagates them to `gpui_linux` when building examples.

Release Notes:

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

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
````

## Parents

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

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