winit: "internal error: entered unreachable code" when using Wayland backend

Attempting to create a Window on the Wayland backend on my system results in the following:

thread 'main' panicked at 'internal error: entered unreachable code', /home/slabity/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.23.0/src/platform_impl/linux/wayland/window/mod.rs:218:77
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[wayland-client error] A handler for wl_keyboard panicked.

Which seems to be coming from this:

// To make our window usable for drawing right away we must `ack` a `configure`
// from the server, the acking part here is done by SCTK window frame, so we just
// need to sync with server so it'll be done automatically for us.
event_loop_handle.with_source(&wayland_source, |event_queue| {
    let event_queue = event_queue.queue();
    let _ = event_queue.sync_roundtrip(&mut *winit_state, |_, _, _| unreachable!());
});

Can anyone explain what this little piece of code is doing and what would cause the it to be reachable?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

This worked for me: sudo apt install libxkbcommon-dev libegl1 libwayland-dev 🚀

The same error occured to me - maybe this issue should be re-opened to add a more helpful error message

Oh, do you have libxkbcommon installed and also on which distro are you on? IIRC you can only reach that code if we failed to open libxkbcommon or something like that.