我正在用eframe创建一个EGUI应用程序,我一直在测试它,并将它编译到WASM和Windows。最近,由于这个错误,它停止编译到Windows(exe)。
error: process didn't exit successfully: `target\debug\TestApp.exe` (exit code: 101)
回溯:
thread 'main' panicked at 'assertion failed: min <= max', /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\core\src\num\f32.rs:1394:9
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library\std\src\panicking.rs:575
1: core::panicking::panic_fmt
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library\core\src\panicking.rs:65
2: core::panicking::panic
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library\core\src\panicking.rs:115
3: core::f32::impl$0::clamp
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\core\src\num\f32.rs:1394
4: emath::pos2::Pos2::clamp
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\emath-0.21.0\src\pos2.rs:187
5: egui_winit::window_settings::WindowSettings::clamp_window_to_sane_position<enum2$<eframe::native::run::UserEvent> >
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\egui-winit-0.21.0\src\window_settings.rs:132
6: eframe::native::epi_integration::window_builder<enum2$<eframe::native::run::UserEvent> >
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\epi_integration.rs:127
7: eframe::native::run::glow_integration::impl$2::on_event
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\run.rs:874
8: winit::platform_impl::platform::event_loop::impl$3::run_return::closure$0<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop.rs:256
9: alloc::boxed::impl$46::call_mut
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\alloc\src\boxed.rs:1994
10: winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop\runner.rs:250
11: core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\core\src\panic\unwind_safe.rs:271
12: std::panicking::try::do_call
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\std\src\panicking.rs:483
13: std::panicking::try
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\std\src\panicking.rs:447
14: std::panic::catch_unwind
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\std\src\panic.rs:137
15: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::catch_unwind
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop\runner.rs:157
16: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_event_handler<enum2$<eframe::native::run::UserEvent> >
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop\runner.rs:242
17: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_new_events
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop\runner.rs:402
18: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::move_state_to<enum2$<eframe::native::run::UserEvent> >
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop\runner.rs:312
19: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::poll
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop\runner.rs:206
20: winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> >::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::
glow_integration::GlowWinitApp> >
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.1\src\platform_impl\windows\event_loop.rs:265
21: eframe::native::run::run_and_return<eframe::native::run::glow_integration::GlowWinitApp>
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\run.rs:115
22: eframe::native::run::glow_integration::run_glow::closure$0
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\run.rs:985
23: eframe::native::run::with_event_loop::closure$0
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\run.rs:99
24: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::try_with
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\std\src\thread\local.rs:446
25: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::with<core::cell::RefCell<enum2$<core::option::Option<winit::ev
ent_loop::EventLoop<enum2$<eframe::na
26: eframe::native::run::with_event_loop
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\run.rs:92
27: eframe::native::run::glow_integration::run_glow
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\native\run.rs:982
28: eframe::run_native
at C:\Users\adavi\.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.21.0\src\lib.rs:199
29: TestApp::main
at .\src\main.rs:16
30: core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > (*)(),tuple$<> >
at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\core\src\ops\function.rs:251
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\TestApp.exe` (exit code: 101)
这是我的main
函数:
#[cfg(not(target_arch = "wasm32"))]
fn main() -> eframe::Result<()> {
// Log to stdout (if you run with `RUST_LOG=debug`).
tracing_subscriber::fmt::init();
let native_options = eframe::NativeOptions::default();
eframe::run_native(
"Visualisation",
native_options,
Box::new(|cc| Box::new(TestApp::Visualisation::new(cc))),
)
}
1条答案
按热度按时间kpbwa7wx1#
这似乎是
egui_winit 0.21.0
中的bug,在下一个发布的版本中修复了。只要更新你的egui
依赖项,一切都应该没问题。