LLVM assertion "Ptr must be a pointer to Val type!" failed.
Compiling this code yield LLVM assertion "Ptr must be a pointer to Val type!"
pub mod Bar {
pub struct Foo {
v: int,
}
extern {
#[rust_stack]
pub fn foo(v: *Foo) -> Foo;
}
}
fn main() { }
rustc: /home/ilyoan/project/rust/rust/src/llvm/lib/IR/Instructions.cpp:1084: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast
#4653, #4760 and #6390 produce the same error message, but I'm not sure if those are the same issue.
Reproduced 93c270c63d158805a068b8e7ced660df1051c3ca -- nominating for milestone 5, production-ready
Note that #4653, #4760, and #6390 are all fixed, so this is a different bug (this is a common error message with many different causes).
Reproduced. Slight minimization: if you switch the return value to a *Foo it gets through translation. So I think it's just the unhandled combination of #[rust_stack], extern and return-by-structure.
0266172eae470050d9ca4f9de2df61377a770ec3 added a test (run-pass/issue-6470.rs)
accepted for production-ready
I am a bit surprised this doesn't work; it will probably depend on the specific ABI we test
This code now compiles, looks like the test just needs to be un-xfail'd. Flagging as needstest