Skip to content

Constants not correctly aligned #348

Closed
@bjorn3

Description

@bjorn3
fn main() {
    let slice = &[0, 1] as &[i32];
    unsafe { std::slice::from_raw_parts(slice as *const [i32] as *const i32, 1); }
}
thread 'main' panicked at 'attempt to create unaligned slice', sysroot_src/src/libcore/slice/mod.rs:4892:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions