Closed
Description
#![feature(asm)]
fn main() {
unsafe { asm!("call $0" :: "i"(test) :: "intel"); }
}
extern fn test() {}
For some reason, this crashes rustc. However, the following test compiles properly in some cases:
#![feature(asm)]
fn main() {
unsafe { asm!("call $0" :: "i"(test as *const u8) :: "intel"); }
}
extern fn test() {}
But, in a real world project, the exact same code I get errors such as error: invalid operand for inline asm constraint 'i'
or compile-time segfaults.