You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
#[repr(packed)]
struct Foo { x: u8, y: u8 }
fn main(foo: Foo) {
let c = || {
let z: &u8 = unsafe { &foo.x };
};
// cannot capture `foo.x` at the point of closure *creation*, must just capture `foo`
// In your code:
// You'll see a place like `[foo, x]`
// if you have a field projection where the field is defined in a `#[repr(packed)]` struct, you need to capture the struct itself
}