-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
This doesn't work with memoffset:
struct Foo {
bar: f32,
baz: [f32],
}
offset_of!(Foo, bar);Even though this (unsound) code works:
struct Foo {
bar: f32,
baz: [f32],
}
let foo_ptr: &Foo = unsafe { mem::zeroed() };
let foo_offs = (&foo_ptr.bar) as *const _ as usize;I ran into this problem when trying to port glium to memoffset in glium/glium#1782. The gpgpu example has relied on offset of calculations supporting unsized structs. I could work around the issue by changing the gpgpu example, but that isn't really perfect.
bluebear94
Metadata
Metadata
Assignees
Labels
No labels