-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
Given an invalid definition of main, like fn main(a: int) {}
, rustc complains, and suggests:
foo.rs:1:0: 1:18 error: Wrong type in main function: found `fn(int)`, expected `extern fn(++v: ~[~str]) -> ()` or `extern fn() -> ()`
Naively, I went and put extern fn main() {}
or even extern fn main(++args: ~[~str]) {}
in my code, including the spurious extern
, and now rustc chokes on it:
rustc: [...]/rust/src/llvm/lib/VMCore/Instructions.cpp:275: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&): Assertion `(Args.size() == FTy->getNumParams() || (FTy->isVarArg() && Args.size() > FTy->getNumParams())) && "Calling a function with bad signature!"' failed.
Aborted
Neither of these messages should happen quite like that. :)
This is on commit b68d287 on the incoming branch.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.