gpui_linux: Improve error message when X11 and Wayland feature flags are missing (#58685)

Improves `gpui_linux` error messages for missing feature flags.
Currently, you'd need to look at the source & Rust backtrace to diagnose
the error shown when the feature flags are missing.

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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable


Release Notes:

- Improve `gpui_linux` error messages for missing feature flags

---------

Co-authored-by: Tom Houlé <tom@tomhoule.com>
This commit is contained in:
Zax71 2026-06-25 17:28:21 +01:00 committed by GitHub
parent 9de0590a81
commit dae3e574e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,6 +52,8 @@ pub fn current_platform(headless: bool) -> Rc<dyn gpui::Platform> {
"Headless" => Rc::new(LinuxPlatform {
inner: HeadlessClient::new(),
}),
_ => unreachable!(),
_ => unreachable!(
r#"At least one of the "wayland" or "x11" features must be enabled on gpui_linux or gpui_platform."#
),
}
}