Skip to content
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

Constants not correctly aligned #348

Closed
bjorn3 opened this issue Feb 16, 2019 · 0 comments
Closed

Constants not correctly aligned #348

bjorn3 opened this issue Feb 16, 2019 · 0 comments
Labels
C-bug Category: This is a bug.
Milestone

Comments

@bjorn3
Copy link
Member

bjorn3 commented Feb 16, 2019

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant