-
-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hello world example causes compiler panic on windows #56
Comments
Hmm.... that's not good. I don't have a windows box but my version running on macOS checks just fine. Can you try checking the expansion too? I could release a patch that works around this bug, since given your stack trace I think I know where the ICE is coming from. fn app(cx: Scope) -> Element {
cx.render(LazyNodes::new_some(move |__cx: NodeFactory| -> VNode {
use dioxus_elements::{GlobalAttributes, SvgAttributes};
__cx.element(
dioxus_elements::div,
[],
[],
[__cx.text(format_args!("Hello, world!"))],
None,
)
}))
} |
I get the same result with the expanded code:
|
Edit: I have been able to replicate the bug compiling from scratch. Disregard the previous suggestion. |
For what it's worth, any code that has a dependency on dioxus seems to yield the same error, even with my main code being Something inside dioxus is causing the rust compiler to panic. |
I've uploaded Can you try changing your Dioxus dependency to dioxus = { git = "https://github.com/DioxusLabs/dioxus", branch = "jk/fix-ice", features = [ "desktop"] } This should remove the generics around |
@jkelleyrtp I'm trying (and failing) to create a minimally reproducible example for the rust compiler team. I see that the generics around AsRef seem to be the issue, so I'll check if that's in the known internal compiler errors repository. |
The The |
Looks like the bug is in LazyNodes. I use the same logic from https://docs.rs/stack_dst/latest/stack_dst/ - maybe they also cause an ICE. Found a simply workaround/fix, going to publish it. @anderslanglands @Patrick-Poitras |
I found a minimal example, it features the stuff from nodes and lazynodes. use std::mem;
use std::marker::PhantomData;
struct LazyStack {}
impl Drop for LazyStack {
fn drop(&mut self) {
let g: *mut dyn FnMut(Option<NodeFactory<'_>>) -> Option<VNode<'_>> =
unsafe {make_fat_ptr()};
let clos = (unsafe { &mut *g });
clos(None);
}
}
unsafe fn make_fat_ptr<T: ?Sized>() -> *mut T {
mem::MaybeUninit::<*mut T>::uninit().assume_init()
}
enum VNode<'src> {
Fragment(&'src [VNode<'src>]),
}
struct NodeFactory<'a> {
x : &'a PhantomData<u32>,
} I don't know what simplified into |
The current version of Dioxus runs in my windows VM and has been pushed. Very interesting it triggered the ICE. @Patrick-Poitras That's a pretty crazy set of incantations... |
@jkelleyrtp the `jk/fix-ice' branch does indeed fix the ICE but running the example gives me:
|
Looks like windows redirects the WebView when it loads. Try the Sorry... I don't use windows so I didn't know about either of these! |
@jkelleyrtp yep that works now! Only weird thing is that the "Hello, world!" text doesn't render until I move or resize the window. |
Strange - but at least I know where to look. The event loop on windows probably sleeps or doesn't call the "events cleared" message. I'm getting the same behavior so at least I can debug it now. |
Closing this issue because we no longer cause an ICE, but looking at the other win issues. |
We've put the ICE into the database over on the language side. |
Excited to try it out so had a crack at the hello world example on Windows just now and it causes an ICE:
rust-lang/rust#92537
The text was updated successfully, but these errors were encountered: