-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
dioxus hello world example causes compiler panic on windows #92537
Comments
Can confirm bug is replicable with example above.
|
Confirmed on Windows 10 for me as well ( |
Including the error for completeness.
|
Seems like they managed to get a patch out that fixes the issue. With that information, I think this may be related to #89189. |
I have spent the last 2 hours whittling down the entire codebase that they had, in order to have a minimal example. It's fairly weird. 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'm not 100%, but I figure that |
Can someone on Windows try this as well (build as lib), because I've tried to add this to glacier, but it seems to compile there, and it seems to also compile on Rust Playground. I'm a bit at a loss. |
@Patrick-Poitras Can you be more specific? What do you want me (us) to try? |
@Patrick-Poitras yep your example panics for me on Windows. |
@cbeust I'd like someone to try the minimal example that I've pasted above, since it doesn't compile on my machine (Windows), but it seems from the other issues thread (on dioxus) that it's a Windows-specific problem. When I've run it on linux machines, it seems to compile there. Edit: @anderslanglands, thanks! I'll try to get a discussion going on Zulip as to what could cause this. |
Doesn't ICE for windows -gnu targets, just -msvc |
Seems to be debug info related, only ices with |
I have further narrowed it down: use std::mem::MaybeUninit;
unsafe fn make_fat_ptr<T: ?Sized>(_: &u32) -> *mut T {
MaybeUninit::<*mut T>::uninit().assume_init()
}
struct VNode<'src> {
_x: &'src [VNode<'src>]
}
fn main() {
let g: *mut dyn Fn(&'_ u32) -> Option<VNode<'_>> =
unsafe {make_fat_ptr(&12)};
} The key here is really in the small modifications that will make it work. I now think the bug occurs when it's trying to check if |
Here is what I've gathered so far: Clue 1: The self-referential slice is important.
struct VNode {
_x: [VNode]
} Will give the However, removing the slice compiles: struct VNode<'src> {
_x: &'src VNode<'src>
} Clue 2: Not wrapping in an Option type compiles successfully.If we change fn main() {
let g: *mut dyn Fn(&'_ u32) -> VNode<'_> =
unsafe {make_fat_ptr(&12)};
} Less key bits
|
Bisect results:
|
I think its #87153, it has a provision that changed the generation of MSVC-only debug information. I'm going to confirm manually. Tagging @michaelwoerister, who might have some input on how to remedy this. |
No longer ICEs since #95020 |
Hi, sorry, this somehow slipped through the cracks. Yes, #95020 should be the proper fix here. The test case there should be pretty much equivalent to the one listed in #92537 (comment). |
As title. Happens with both stable and nightly
Code
main.rs:
Cargo.toml:
Meta
rustc --version --verbose
:rustc +nightly --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: