Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Add minimal example for issue 92537 #1073

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions ices/92537.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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>,
}

fn main() {
let _x = LazyStack{};
}