Repository: iced-rs/iced (language: rust)

Issue:
rendering only empty meshes crashes iced
### Is your issue REALLY a bug?

- [x] My issue is indeed a bug!
- [x] I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

### Is there an existing issue for this?

- [x] I have searched the existing issues.

### Is this issue related to iced?

- [x] My hardware is compatible and my graphics drivers are up-to-date.

### What happened?

The following code crashes:
```rs
use iced::{
    advanced::{
        graphics::{
            mesh::{self, Renderer as _},
            Mesh,
        },
        layout::{Limits, Node},
        renderer::Style,
        widget::Tree,
        Layout, Widget,
    },
    mouse::Cursor,
    Length, Rectangle, Renderer, Size, Theme, Transformation,
};

fn main() {
    iced::application("", App::update, App::view).run().unwrap();
}

struct App;

#[derive(Debug)]
enum Message {}

impl App {
    fn new() -> Self {
        Self
    }

    fn update(&mut self, _: Message) {}

    fn view(&self) -> iced::Element<'_, Message> {
        iced::Element::new(Test)
    }
}

impl Default for App {
    fn default() -> Self {
        Self::new()
    }
}

struct Test;

impl Widget<Message, Theme, Renderer> for Test {
    fn size(&self) -> Size<Length> {
        Size::new(Length::Fill, Length::Fill)
    }

    fn layout(&self, _tree: &mut Tree, _renderer: &Renderer, limits: &Limits) -> Node {
        Node::new(limits.max())
    }

    fn draw(
        &self,
        _tree: &Tree,
        renderer: &mut Renderer,
        _theme: &Theme,
        _style: &Style,
        _layout: Layout<'_>,
        _cursor: Cursor,
        _viewport: &Rectangle,
    ) {
        renderer.draw_mesh(Mesh::Solid {
            buffers: mesh::Indexed {
                vertices: Vec::new(),
                indices: Vec::new(),
            },
            transformation: Transformation::IDENTITY,
            clip_bounds: Rectangle::INFINITE,
        });
    }
}
```

<details>

<summary>backtrace (crates.io)</summary>

```
thread 'main' panicked at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/buffer.rs:98:14:
non-empty write: TryFromIntError(())
stack backtrace:
   0:     0x5c1f6192f3fa - std::backtrace_rs::backtrace::libunwind::trace::h886f3b0575353f6e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x5c1f6192f3fa - std::backtrace_rs::backtrace::trace_unsynchronized::h652d1041ec67eb09
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5c1f6192f3fa - std::sys::backtrace::_print_fmt::hd0317245a04c3039
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:66:9
   3:     0x5c1f6192f3fa - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h14b23c1989cbd5c2
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:39:26
   4:     0x5c1f6195ae63 - core::fmt::rt::Argument::fmt::h43c1e387827e30dc
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/rt.rs:177:76
   5:     0x5c1f6195ae63 - core::fmt::write::h346b5eee5ed4d7cc
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/mod.rs:1189:21
   6:     0x5c1f6192b043 - std::io::Write::write_fmt::heeb48dcd4a60b46b
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/io/mod.rs:1884:15
   7:     0x5c1f6192f242 - std::sys::backtrace::BacktraceLock::print::h48db11f3fd4983ff
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:42:9
   8:     0x5c1f6193034c - std::panicking::default_hook::{{closure}}::h65db976b9c0d8674
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:268:22
   9:     0x5c1f61930192 - std::panicking::default_hook::h6eb3a1192db1ae36
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:295:9
  10:     0x5c1f61930987 - std::panicking::rust_panic_with_hook::h370ee1901241e459
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:801:13
  11:     0x5c1f6193081a - std::panicking::begin_panic_handler::{{closure}}::heabfe92676d6d073
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:674:13
  12:     0x5c1f6192f8d9 - std::sys::backtrace::__rust_end_short_backtrace::h6e22d229d4fdf49e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:170:18
  13:     0x5c1f619304ac - rust_begin_unwind
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:665:5
  14:     0x5c1f619585f0 - core::panicking::panic_fmt::hfae270fab21da3e6
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:76:14
  15:     0x5c1f61958ad6 - core::result::unwrap_failed::h82c78b552479728a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/result.rs:1699:5
  16:     0x5c1f60afaaec - core::result::Result<T,E>::expect::h62510563f66155e7
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1061:23
  17:     0x5c1f60b10846 - iced_wgpu::buffer::Buffer<T>::write::h49bedc545fd094af
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/buffer.rs:96:26
  18:     0x5c1f60b1452b - iced_wgpu::triangle::Layer::prepare::hc1f100d87af2e1a6
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/triangle.rs:441:29
  19:     0x5c1f60b13308 - iced_wgpu::triangle::Pipeline::prepare::hbce0364efe1a03cb
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/triangle.rs:212:21
  20:     0x5c1f60b06e8d - iced_wgpu::Renderer::prepare::h9708d4c8419daa12
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/lib.rs:161:17
  21:     0x5c1f6044e32c - iced_wgpu::Renderer::present::h1aa223b5ded0feaa
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/lib.rs:125:9
  22:     0x5c1f603e313b - iced_wgpu::window::compositor::present::h446ea4981052c387
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/window/compositor.rs:230:13
  23:     0x5c1f603df336 - <iced_wgpu::window::compositor::Compositor as iced_graphics::compositor::Compositor>::present::hda54e0793847e1a9
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_wgpu-0.13.5/src/window/compositor.rs:361:9
  24:     0x5c1f604e0d2f - iced_winit::program::run_instance::{{closure}}::he8448438405bca8c
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_winit-0.13.0/src/program.rs:908:31
  25:     0x5c1f604e4988 - iced_winit::program::run::Runner<Message,F,C>::process_event::h619d5983309c31c6
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_winit-0.13.0/src/program.rs:467:28
  26:     0x5c1f604e5a56 - <iced_winit::program::run::Runner<Message,F,C> as winit::application::ApplicationHandler<iced_runtime::Action<Message>>>::window_event::h5f0bee827b9e7ec7
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_winit-0.13.0/src/program.rs:396:13
  27:     0x5c1f6047f8f0 - winit::event_loop::dispatch_event_for_app::h9c39c0d0a9d61de9
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/event_loop.rs:642:52
  28:     0x5c1f6047f8f0 - winit::event_loop::EventLoop<T>::run_app::{{closure}}::hf2a155e591b5536b
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/event_loop.rs:265:49
  29:     0x5c1f6047f6bf - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h1a49e159e4fda86a
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  30:     0x5c1f6047f71f - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h40758fde205656f8
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  31:     0x5c1f604c2c24 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::single_iteration::h367e6a6b90693b0c
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/platform_impl/linux/wayland/event_loop/mod.rs:469:17
  32:     0x5c1f604c7793 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::poll_events_with_timeout::h4a7b4759f3bb5242
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/platform_impl/linux/wayland/event_loop/mod.rs:295:9
  33:     0x5c1f604c125f - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::pump_events::hcf5a6f49d7ceb2c1
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/platform_impl/linux/wayland/event_loop/mod.rs:217:13
  34:     0x5c1f604c1c13 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::run_on_demand::h067517773229f72f
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/platform_impl/linux/wayland/event_loop/mod.rs:181:19
  35:     0x5c1f604e6a1b - winit::platform_impl::linux::EventLoop<T>::run_on_demand::h97b9840630081344
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/platform_impl/linux/mod.rs:819:56
  36:     0x5c1f604e725a - winit::platform_impl::linux::EventLoop<T>::run::hd91bdca5c8db2db2
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/platform_impl/linux/mod.rs:812:9
  37:     0x5c1f6047f7f1 - winit::event_loop::EventLoop<T>::run_app::h03423f3c2b562943
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.8/src/event_loop.rs:265:9
  38:     0x5c1f604e40e5 - iced_winit::program::run::h1ad8520d0fe60565
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_winit-0.13.0/src/program.rs:605:17
  39:     0x5c1f60475357 - iced::program::Program::run_with::h143247e6f1587cca
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced-0.13.1/src/program.rs:177:12
  40:     0x5c1f6047502a - iced::program::Program::run::h56695b2b203a1e3c
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced-0.13.1/src/program.rs:81:9
  41:     0x5c1f6047f343 - iced::application::Application<P>::run::h55d1816d163a6af5
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced-0.13.1/src/application.rs:167:9
  42:     0x5c1f6040b3c7 - iced_test::main::h714f1a112c809ab6
                               at /home/edwin/git/iced_test/src/main.rs:17:5
  43:     0x5c1f604a969b - core::ops::function::FnOnce::call_once::h9c213b50c26bf46c
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  44:     0x5c1f6047bb2e - std::sys::backtrace::__rust_begin_short_backtrace::h544bf2ac359e5de9
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:154:18
  45:     0x5c1f60400f01 - std::rt::lang_start::{{closure}}::hc0bdce91b06bf38f
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:195:18
  46:     0x5c1f61924537 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h35f8c1e62d62acc8
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/ops/function.rs:284:13
  47:     0x5c1f61924537 - std::panicking::try::do_call::hf68c0838c361652d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:557:40
  48:     0x5c1f61924537 - std::panicking::try::hd0db3bdfbc72102d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:520:19
  49:     0x5c1f61924537 - std::panic::catch_unwind::hc4de95e5d3f6ff5a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panic.rs:358:14
  50:     0x5c1f61924537 - std::rt::lang_start_internal::{{closure}}::hd93f66b74e68451d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/rt.rs:174:48
  51:     0x5c1f61924537 - std::panicking::try::do_call::h1cab56842903f0d9
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:557:40
  52:     0x5c1f61924537 - std::panicking::try::h745f929dec89d652
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:520:19
  53:     0x5c1f61924537 - std::panic::catch_unwind::hc9411728c13048ef
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panic.rs:358:14
  54:     0x5c1f61924537 - std::rt::lang_start_internal::h712a1d4742291d0c
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/rt.rs:174:20
  55:     0x5c1f60400eda - std::rt::lang_start::h59e0d7eb72ef00b2
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:194:17
  56:     0x5c1f6040b6de - main
  57:     0x7efbd7cebe08 - <unknown>
  58:     0x7efbd7cebecc - __libc_start_main
  59:     0x5c1f603d11f5 - _start
  60:                0x0 - <unknown>
```

</details>

<details>

<summary>backtrace (master)</summary>

```

thread 'main' panicked at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/buffer.rs:100:14:
non-empty write: TryFromIntError(())
stack backtrace:
   0:     0x58e0b8c1620a - std::backtrace_rs::backtrace::libunwind::trace::h886f3b0575353f6e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x58e0b8c1620a - std::backtrace_rs::backtrace::trace_unsynchronized::h652d1041ec67eb09
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x58e0b8c1620a - std::sys::backtrace::_print_fmt::hd0317245a04c3039
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:66:9
   3:     0x58e0b8c1620a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h14b23c1989cbd5c2
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:39:26
   4:     0x58e0b8c421e3 - core::fmt::rt::Argument::fmt::h43c1e387827e30dc
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/rt.rs:177:76
   5:     0x58e0b8c421e3 - core::fmt::write::h346b5eee5ed4d7cc
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/mod.rs:1189:21
   6:     0x58e0b8c11c83 - std::io::Write::write_fmt::heeb48dcd4a60b46b
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/io/mod.rs:1884:15
   7:     0x58e0b8c16052 - std::sys::backtrace::BacktraceLock::print::h48db11f3fd4983ff
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:42:9
   8:     0x58e0b8c1715c - std::panicking::default_hook::{{closure}}::h65db976b9c0d8674
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:268:22
   9:     0x58e0b8c16fa2 - std::panicking::default_hook::h6eb3a1192db1ae36
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:295:9
  10:     0x58e0b8c17797 - std::panicking::rust_panic_with_hook::h370ee1901241e459
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:801:13
  11:     0x58e0b8c1762a - std::panicking::begin_panic_handler::{{closure}}::heabfe92676d6d073
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:674:13
  12:     0x58e0b8c166e9 - std::sys::backtrace::__rust_end_short_backtrace::h6e22d229d4fdf49e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:170:18
  13:     0x58e0b8c172bc - rust_begin_unwind
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:665:5
  14:     0x58e0b8c3f620 - core::panicking::panic_fmt::hfae270fab21da3e6
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:76:14
  15:     0x58e0b8c3fb06 - core::result::unwrap_failed::h82c78b552479728a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/result.rs:1699:5
  16:     0x58e0b7df120c - core::result::Result<T,E>::expect::h7d7606d87c2e5730
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1061:23
  17:     0x58e0b7e0e4e6 - iced_wgpu::buffer::Buffer<T>::write::hf7cac435a42d3757
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/buffer.rs:98:26
  18:     0x58e0b7def89b - iced_wgpu::triangle::Layer::prepare::hc3f1038397c3e0da
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/triangle.rs:441:29
  19:     0x58e0b7dee638 - iced_wgpu::triangle::Pipeline::prepare::h36bc49727a1638ec
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/triangle.rs:212:21
  20:     0x58e0b7dfafae - iced_wgpu::Renderer::prepare::hf889bd66e627c044
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/lib.rs:173:17
  21:     0x58e0b77e15dc - iced_wgpu::Renderer::present::h85e5472411a3928a
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/lib.rs:125:9
  22:     0x58e0b77db657 - iced_wgpu::window::compositor::present::h17628fcdc3cf9bf0
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/window/compositor.rs:236:13
  23:     0x58e0b77d7746 - <iced_wgpu::window::compositor::Compositor as iced_graphics::compositor::Compositor>::present::he86279d338f1b101
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/wgpu/src/window/compositor.rs:367:9
  24:     0x58e0b77b6283 - iced_winit::program::run_instance::{{closure}}::hf8ae5bfa041c781c
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:879:31
  25:     0x58e0b77bac07 - iced_winit::program::run::Runner<Message,F>::process_event::h35c8f1097237e057
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:354:28
  26:     0x58e0b77bbf4f - <iced_winit::program::run::Runner<Message,F> as winit::application::ApplicationHandler<iced_runtime::Action<Message>>>::window_event::h4c333107efd3f79f
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:272:13
  27:     0x58e0b777b550 - winit::event_loop::dispatch_event_for_app::hf67d11328cb4d459
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/event_loop.rs:642:52
  28:     0x58e0b777b550 - winit::event_loop::EventLoop<T>::run_app::{{closure}}::he5988236b99725a8
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/event_loop.rs:265:49
  29:     0x58e0b777b30f - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h4b6880af2f61d837
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  30:     0x58e0b777b36f - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h520495853c3ff074
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  31:     0x58e0b7795b14 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::single_iteration::h167127bb818e81a0
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:469:17
  32:     0x58e0b779a683 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::poll_events_with_timeout::h3a710ee1f57c8cce
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:295:9
  33:     0x58e0b779414f - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::pump_events::h9ecbca355208e428
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:217:13
  34:     0x58e0b7794b03 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::run_on_demand::h8fbd9de6bdaba871
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:181:19
  35:     0x58e0b77bc31b - winit::platform_impl::linux::EventLoop<T>::run_on_demand::hbb1c105996f1104f
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/mod.rs:819:56
  36:     0x58e0b77bcb5a - winit::platform_impl::linux::EventLoop<T>::run::h0b4b16f311c9fd82
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/mod.rs:812:9
  37:     0x58e0b777b441 - winit::event_loop::EventLoop<T>::run_app::h4bf12551481ddf56
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/event_loop.rs:265:9
  38:     0x58e0b77ba547 - iced_winit::program::run::h0d3a500222111195
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:511:17
  39:     0x58e0b774ab57 - iced::program::Program::run_with::ha0d994d3a7c87f1b
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/src/program.rs:176:12
  40:     0x58e0b774a82a - iced::program::Program::run::h4ab8fd77a92e44b3
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/src/program.rs:80:9
  41:     0x58e0b77e18a3 - iced::application::Application<P>::run::h6afa40603c732b6c
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/src/application.rs:166:9
  42:     0x58e0b7706347 - iced_test::main::hf73a75ebcb40a542
                               at /home/edwin/git/iced_test/src/main.rs:17:5
  43:     0x58e0b76c90fb - core::ops::function::FnOnce::call_once::hd917561321e13254
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  44:     0x58e0b7771a3e - std::sys::backtrace::__rust_begin_short_backtrace::hfc7d78a42dbaadc7
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:154:18
  45:     0x58e0b7764aa1 - std::rt::lang_start::{{closure}}::hc45e1f95a996b879
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:195:18
  46:     0x58e0b8c0a507 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h35f8c1e62d62acc8
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/ops/function.rs:284:13
  47:     0x58e0b8c0a507 - std::panicking::try::do_call::hf68c0838c361652d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:557:40
  48:     0x58e0b8c0a507 - std::panicking::try::hd0db3bdfbc72102d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:520:19
  49:     0x58e0b8c0a507 - std::panic::catch_unwind::hc4de95e5d3f6ff5a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panic.rs:358:14
  50:     0x58e0b8c0a507 - std::rt::lang_start_internal::{{closure}}::hd93f66b74e68451d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/rt.rs:174:48
  51:     0x58e0b8c0a507 - std::panicking::try::do_call::h1cab56842903f0d9
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:557:40
  52:     0x58e0b8c0a507 - std::panicking::try::h745f929dec89d652
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:520:19
  53:     0x58e0b8c0a507 - std::panic::catch_unwind::hc9411728c13048ef
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panic.rs:358:14
  54:     0x58e0b8c0a507 - std::rt::lang_start_internal::h712a1d4742291d0c
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/rt.rs:174:20
  55:     0x58e0b7764a7a - std::rt::lang_start::h8964903610889c8d
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:194:17
  56:     0x58e0b770665e - main
  57:     0x7aec086bce08 - <unknown>
  58:     0x7aec086bcecc - __libc_start_main
  59:     0x58e0b76beab5 - _start
  60:                0x0 - <unknown>
thread 'main' panicked at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-23.0.1/src/vulkan/instance.rs:173:58:
Trying to destroy a SurfaceSemaphores that is still in use by a SurfaceTexture
stack backtrace:
   0:     0x58e0b8c1620a - std::backtrace_rs::backtrace::libunwind::trace::h886f3b0575353f6e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x58e0b8c1620a - std::backtrace_rs::backtrace::trace_unsynchronized::h652d1041ec67eb09
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x58e0b8c1620a - std::sys::backtrace::_print_fmt::hd0317245a04c3039
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:66:9
   3:     0x58e0b8c1620a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h14b23c1989cbd5c2
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:39:26
   4:     0x58e0b8c421e3 - core::fmt::rt::Argument::fmt::h43c1e387827e30dc
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/rt.rs:177:76
   5:     0x58e0b8c421e3 - core::fmt::write::h346b5eee5ed4d7cc
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/fmt/mod.rs:1189:21
   6:     0x58e0b8c11c83 - std::io::Write::write_fmt::heeb48dcd4a60b46b
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/io/mod.rs:1884:15
   7:     0x58e0b8c16052 - std::sys::backtrace::BacktraceLock::print::h48db11f3fd4983ff
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:42:9
   8:     0x58e0b8c1715c - std::panicking::default_hook::{{closure}}::h65db976b9c0d8674
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:268:22
   9:     0x58e0b8c16fa2 - std::panicking::default_hook::h6eb3a1192db1ae36
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:295:9
  10:     0x58e0b8c17797 - std::panicking::rust_panic_with_hook::h370ee1901241e459
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:801:13
  11:     0x58e0b8c1762a - std::panicking::begin_panic_handler::{{closure}}::heabfe92676d6d073
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:674:13
  12:     0x58e0b8c166e9 - std::sys::backtrace::__rust_end_short_backtrace::h6e22d229d4fdf49e
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/sys/backtrace.rs:170:18
  13:     0x58e0b8c172bc - rust_begin_unwind
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:665:5
  14:     0x58e0b8c3f620 - core::panicking::panic_fmt::hfae270fab21da3e6
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:76:14
  15:     0x58e0b8c3f5fb - core::panicking::panic_display::hba90d49fe99447f3
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:269:5
  16:     0x58e0b8c3f5fb - core::option::expect_failed::h4fcf8d736ca0f962
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/option.rs:2018:5
  17:     0x58e0b87c2fba - core::option::Option<T>::expect::he5e9842585dbcd95
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:933:21
  18:     0x58e0b86cb0bf - wgpu_hal::vulkan::instance::<impl wgpu_hal::vulkan::Swapchain>::release_resources::hac60dc83cb16008f
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-23.0.1/src/vulkan/instance.rs:173:31
  19:     0x58e0b86d0508 - wgpu_hal::vulkan::instance::<impl wgpu_hal::Surface for wgpu_hal::vulkan::Surface>::unconfigure::he0316859a7496137
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-23.0.1/src/vulkan/instance.rs:986:38
  20:     0x58e0b85767e9 - <S as wgpu_hal::dynamic::surface::DynSurface>::unconfigure::hb68e713857ac78ce
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-23.0.1/src/dynamic/surface.rs:47:18
  21:     0x58e0b8456e1e - <wgpu_core::instance::Surface as core::ops::drop::Drop>::drop::h053a0fe15f62d51b
                               at /home/edwin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-23.0.1/src/instance.rs:437:30
  22:     0x58e0b8600da7 - core::ptr::drop_in_place<wgpu_core::instance::Surface>::hfd6c7fe670242524
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  23:     0x58e0b83dc372 - alloc::sync::Arc<T,A>::drop_slow::h8af74935976dafd4
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:1888:18
  24:     0x58e0b83dfb4a - <alloc::sync::Arc<T,A> as core::ops::drop::Drop>::drop::h6a954e7224326890
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:2575:13
  25:     0x58e0b860807b - core::ptr::drop_in_place<alloc::sync::Arc<wgpu_core::instance::Surface>>::h2d82976919aff30c
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  26:     0x58e0b85f797a - core::ptr::drop_in_place<wgpu_core::storage::Element<alloc::sync::Arc<wgpu_core::instance::Surface>>>::h3f83892bdbd2cd7e
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  27:     0x58e0b85f9900 - core::ptr::drop_in_place<[wgpu_core::storage::Element<alloc::sync::Arc<wgpu_core::instance::Surface>>]>::h3e6bceb36a651007
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  28:     0x58e0b83917e7 - <alloc::vec::Vec<T,A> as core::ops::drop::Drop>::drop::h67ba3d685ffcb558
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:3751:13
  29:     0x58e0b85fb7a7 - core::ptr::drop_in_place<alloc::vec::Vec<wgpu_core::storage::Element<alloc::sync::Arc<wgpu_core::instance::Surface>>>>::h606a0bc7bceefe35
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  30:     0x58e0b85f799b - core::ptr::drop_in_place<wgpu_core::storage::Storage<alloc::sync::Arc<wgpu_core::instance::Surface>>>::h3e658deda0d2cd10
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  31:     0x58e0b85fc81b - core::ptr::drop_in_place<core::cell::UnsafeCell<wgpu_core::storage::Storage<alloc::sync::Arc<wgpu_core::instance::Surface>>>>::hb43e8841b54376db
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  32:     0x58e0b85fe4ff - core::ptr::drop_in_place<lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock,wgpu_core::storage::Storage<alloc::sync::Arc<wgpu_core::instance::Surface>>>>::h2351d43f1c6be5bb
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  33:     0x58e0b85fd3fb - core::ptr::drop_in_place<wgpu_core::lock::vanilla::RwLock<wgpu_core::storage::Storage<alloc::sync::Arc<wgpu_core::instance::Surface>>>>::h86a353f6a696c6a6
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  34:     0x58e0b85f81ec - core::ptr::drop_in_place<wgpu_core::registry::Registry<alloc::sync::Arc<wgpu_core::instance::Surface>>>::ha9e9b6485d3c50f5
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  35:     0x58e0b835326f - core::ptr::drop_in_place<wgpu_core::global::Global>::h21adb106ca2327f9
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  36:     0x58e0b83541c4 - core::ptr::drop_in_place<wgpu::backend::wgpu_core::ContextWgpuCore>::h65496301d839ebb9
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  37:     0x58e0b835383d - core::ptr::drop_in_place<dyn wgpu::context::DynContext>::h50479f8af236736b
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  38:     0x58e0b8348ae0 - alloc::sync::Arc<T,A>::drop_slow::h272c3f457c881456
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:1888:18
  39:     0x58e0b8349121 - <alloc::sync::Arc<T,A> as core::ops::drop::Drop>::drop::h20e03a22972f9c63
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:2575:13
  40:     0x58e0b8354d0b - core::ptr::drop_in_place<alloc::sync::Arc<dyn wgpu::context::DynContext>>::h405c928892ef8242
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  41:     0x58e0b7e16a17 - core::ptr::drop_in_place<wgpu::api::bind_group::BindGroup>::h4359d03ec3a29e43
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  42:     0x58e0b76cf23c - core::ptr::drop_in_place<glyphon::viewport::Viewport>::hca2181de7ba5e337
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  43:     0x58e0b76cf14a - core::ptr::drop_in_place<iced_wgpu::text::Viewport>::ha8cf7f7edf158dfe
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  44:     0x58e0b76cee87 - core::ptr::drop_in_place<iced_wgpu::Renderer>::h0633738872daa2b4
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  45:     0x58e0b76cab92 - core::ptr::drop_in_place<iced_winit::program::window_manager::Window<iced::program::Program::run_with::Instance<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}>,<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}> as iced::program::Program>::run::{{closure}}>,iced_wgpu::window::compositor::Compositor>>::h8cae86c64d45ae0a
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  46:     0x58e0b76e2170 - core::mem::maybe_uninit::MaybeUninit<T>::assume_init_drop::h606c4e51cad69d6c
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:733:18
  47:     0x58e0b76e2170 - alloc::collections::btree::node::Handle<alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Dying,K,V,NodeType>,alloc::collections::btree::node::marker::KV>::drop_key_val::hda20ff0fe2c8f5a4
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/node.rs:1180:51
  48:     0x58e0b76db82e - <alloc::collections::btree::map::IntoIter<K,V,A> as core::ops::drop::Drop>::drop::h7de2a80501b2784d
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/map.rs:1692:22
  49:     0x58e0b76cb79a - core::ptr::drop_in_place<alloc::collections::btree::map::IntoIter<iced_core::window::id::Id,iced_winit::program::window_manager::Window<iced::program::Program::run_with::Instance<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}>,<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}> as iced::program::Program>::run::{{closure}}>,iced_wgpu::window::compositor::Compositor>>>::h638fea82d01c304e
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  50:     0x58e0b76db6e8 - core::mem::drop::hecac62e8e9dfcb49
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:942:24
  51:     0x58e0b76db6e8 - <alloc::collections::btree::map::BTreeMap<K,V,A> as core::ops::drop::Drop>::drop::h64dbd9dc4815cb4e
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/map.rs:189:9
  52:     0x58e0b76cb78a - core::ptr::drop_in_place<alloc::collections::btree::map::BTreeMap<iced_core::window::id::Id,iced_winit::program::window_manager::Window<iced::program::Program::run_with::Instance<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}>,<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}> as iced::program::Program>::run::{{closure}}>,iced_wgpu::window::compositor::Compositor>>>::h5e5863ec297ec285
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  53:     0x58e0b76cac83 - core::ptr::drop_in_place<iced_winit::program::window_manager::WindowManager<iced::program::Program::run_with::Instance<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}>,<iced::program::with_title::WithTitle<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>,iced::application::Application<iced::application::application::Instance<iced_test::App,iced_test::Message,iced_core::theme::Theme,iced_wgpu::Renderer,iced_test::App::update,iced_test::App::view>>::title<&str>::{{closure}}> as iced::program::Program>::run::{{closure}}>,iced_wgpu::window::compositor::Compositor>>::hc451fa06feda8993
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:521:1
  54:     0x58e0b77b861c - iced_winit::program::run_instance::{{closure}}::hf8ae5bfa041c781c
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:1126:1
  55:     0x58e0b77bac07 - iced_winit::program::run::Runner<Message,F>::process_event::h35c8f1097237e057
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:354:28
  56:     0x58e0b77bbf4f - <iced_winit::program::run::Runner<Message,F> as winit::application::ApplicationHandler<iced_runtime::Action<Message>>>::window_event::h4c333107efd3f79f
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:272:13
  57:     0x58e0b777b550 - winit::event_loop::dispatch_event_for_app::hf67d11328cb4d459
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/event_loop.rs:642:52
  58:     0x58e0b777b550 - winit::event_loop::EventLoop<T>::run_app::{{closure}}::he5988236b99725a8
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/event_loop.rs:265:49
  59:     0x58e0b777b30f - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h4b6880af2f61d837
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  60:     0x58e0b777b36f - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h520495853c3ff074
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:294:13
  61:     0x58e0b7795b14 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::single_iteration::h167127bb818e81a0
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:469:17
  62:     0x58e0b779a683 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::poll_events_with_timeout::h3a710ee1f57c8cce
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:295:9
  63:     0x58e0b779414f - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::pump_events::h9ecbca355208e428
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:217:13
  64:     0x58e0b7794b03 - winit::platform_impl::linux::wayland::event_loop::EventLoop<T>::run_on_demand::h8fbd9de6bdaba871
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/wayland/event_loop/mod.rs:181:19
  65:     0x58e0b77bc31b - winit::platform_impl::linux::EventLoop<T>::run_on_demand::hbb1c105996f1104f
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/mod.rs:819:56
  66:     0x58e0b77bcb5a - winit::platform_impl::linux::EventLoop<T>::run::h0b4b16f311c9fd82
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/platform_impl/linux/mod.rs:812:9
  67:     0x58e0b777b441 - winit::event_loop::EventLoop<T>::run_app::h4bf12551481ddf56
                               at /home/edwin/.cargo/git/checkouts/winit-57d3141eaf559308/11414b6/src/event_loop.rs:265:9
  68:     0x58e0b77ba547 - iced_winit::program::run::h0d3a500222111195
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/winit/src/program.rs:511:17
  69:     0x58e0b774ab57 - iced::program::Program::run_with::ha0d994d3a7c87f1b
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/src/program.rs:176:12
  70:     0x58e0b774a82a - iced::program::Program::run::h4ab8fd77a92e44b3
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/src/program.rs:80:9
  71:     0x58e0b77e18a3 - iced::application::Application<P>::run::h6afa40603c732b6c
                               at /home/edwin/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/30ee9d0/src/application.rs:166:9
  72:     0x58e0b7706347 - iced_test::main::hf73a75ebcb40a542
                               at /home/edwin/git/iced_test/src/main.rs:17:5
  73:     0x58e0b76c90fb - core::ops::function::FnOnce::call_once::hd917561321e13254
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  74:     0x58e0b7771a3e - std::sys::backtrace::__rust_begin_short_backtrace::hfc7d78a42dbaadc7
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:154:18
  75:     0x58e0b7764aa1 - std::rt::lang_start::{{closure}}::hc45e1f95a996b879
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:195:18
  76:     0x58e0b8c0a507 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h35f8c1e62d62acc8
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/ops/function.rs:284:13
  77:     0x58e0b8c0a507 - std::panicking::try::do_call::hf68c0838c361652d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:557:40
  78:     0x58e0b8c0a507 - std::panicking::try::hd0db3bdfbc72102d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:520:19
  79:     0x58e0b8c0a507 - std::panic::catch_unwind::hc4de95e5d3f6ff5a
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panic.rs:358:14
  80:     0x58e0b8c0a507 - std::rt::lang_start_internal::{{closure}}::hd93f66b74e68451d
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/rt.rs:174:48
  81:     0x58e0b8c0a507 - std::panicking::try::do_call::h1cab56842903f0d9
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:557:40
  82:     0x58e0b8c0a507 - std::panicking::try::h745f929dec89d652
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:520:19
  83:     0x58e0b8c0a507 - std::panic::catch_unwind::hc9411728c13048ef
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panic.rs:358:14
  84:     0x58e0b8c0a507 - std::rt::lang_start_internal::h712a1d4742291d0c
                               at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/rt.rs:174:20
  85:     0x58e0b7764a7a - std::rt::lang_start::h8964903610889c8d
                               at /home/edwin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:194:17
  86:     0x58e0b770665e - main
  87:     0x7aec086bce08 - <unknown>
  88:     0x7aec086bcecc - __libc_start_main
  89:     0x58e0b76beab5 - _start
  90:                0x0 - <unknown>
warning: queue "mesa vk display queue" 0x58e0e838c690 destroyed while proxies still attached:
  wl_buffer#80 still attached
  wl_buffer#78 still attached
  wl_buffer#76 still attached
  wl_buffer#74 still attached
thread 'main' panicked at core/src/panicking.rs:231:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
zsh: IOT instruction (core dumped)  RUST_BACKTRACE=full cargo r
```

</details>

relevant lines:
https://github.com/iced-rs/iced/blob/30ee9d024d00403f2fc0571946fa9ca398117e05/wgpu/src/buffer.rs#L96-L100

happens on both latest master and the crates.io release

### What is the expected behavior?

no crash

### Version

master

### Operating System

Linux

### Do you have any log output?

```shell

```


Discussion / hints:

Fix patch:
diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs
index 2283cf711e..9c9fcb31d4 100644
--- a/wgpu/src/lib.rs
+++ b/wgpu/src/lib.rs
@@ -557,6 +557,16 @@ impl core::svg::Renderer for Renderer {
 
 impl graphics::mesh::Renderer for Renderer {
     fn draw_mesh(&mut self, mesh: graphics::Mesh) {
+        debug_assert!(
+            !mesh.indices().is_empty(),
+            "Mesh must not have empty indices"
+        );
+
+        debug_assert!(
+            mesh.indices().len() % 3 == 0,
+            "Mesh indices length must be a multiple of 3"
+        );
+
         let (layer, transformation) = self.layers.current_mut();
         layer.draw_mesh(mesh, transformation);
     }


Test patch: