Edit(fmease): Add #![feature] to the code example.
When we updated our Rust nightly, and compiled this (elided) code:
#![feature(link_llvm_intrinsics)]
/// The `llvm.embedded.module` symbol in the `.llvmbc` section.
#[repr(C)]
struct EmbeddedModule {
/// The length of the bitcode.
len: usize,
/// The start of the bitcode itself.
first_byte_of_bitcode: u8,
}
// ykllvm adds the `SHF_ALLOC` flag to the `.llvmbc` section so that the loader puts it into our
// address space at load time.
extern "C" {
#[link_name = "llvm.embedded.module"]
static LLVMBC: EmbeddedModule;
}
/// Returns a pointer to (and the size of) the raw LLVM bitcode in the current address space.
pub fn llvmbc_section() -> (*const u8, usize) {
let bc = unsafe { &LLVMBC };
(&bc.first_byte_of_bitcode as *const u8, bc.len)
}
'misaligned pointer dereference: address must be a multiple of 0x8 but is 0x200b2d', ykutil/src/obj.rs:154:23
Where line 154 is:
let bc = unsafe { &LLVMBC };
There is no explicit (language-level) pointer deref on that line.
I wonder if the error message needs to be refined?
Edit(fmease): Add
#![feature]
to the code example.When we updated our Rust nightly, and compiled this (elided) code:
Where line 154 is:
There is no explicit (language-level) pointer deref on that line.
I wonder if the error message needs to be refined?
Thanks