You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extern fn plusone(u: u8) -> u8 {
return u + 1;
}
struct S {
fun: *u8
}
const s: S = S { fun: plusone };
This code does not give any compile errors from rustc, but triggers an assertion in LLVM: "Initializer for struct element doesn't match struct element type!".
Full error message:
rustc: .../rust/src/llvm/lib/VMCore/Constants.cpp:812: llvm::ConstantStruct::ConstantStruct(llvm::StructType*, llvm::ArrayRef<llvm::Constant*>): Assertion `(T->isOpaque() || V[i]->getType() == T->getElementType(i)) && "Initializer for struct element doesn't match struct element type!"' failed.```
The text was updated successfully, but these errors were encountered:
This code does not give any compile errors from rustc, but triggers an assertion in LLVM: "Initializer for struct element doesn't match struct element type!".
Full error message:
The text was updated successfully, but these errors were encountered: