Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message for start function confusing #9575

Closed
metajack opened this issue Sep 27, 2013 · 1 comment
Closed

error message for start function confusing #9575

metajack opened this issue Sep 27, 2013 · 1 comment

Comments

@metajack
Copy link
Contributor

If you had an old start function like:

#[start]
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
 // ...
}

You this message:
error: start function expects type: extern "Rust" fn(int, **u8) -> int: incorrect number of function parameters

However, if actually change the signature to extern "Rust" fn start(argc: int, argv: **u8) -> int` then you get the this message:

error: start function expects type: extern "Rust" fn(int, **u8) -> int: expected impure fn but found extern fn

It took me a bit to figure out that I am not supposed to add extern "Rust" myself.

cc @brson

huonw added a commit to huonw/rust that referenced this issue Jan 31, 2014
@huonw
Copy link
Member

huonw commented Feb 1, 2014

Triage: now fixed, closed when #11966 lands.

@huonw huonw closed this as completed in 6c52e72 Feb 1, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 20, 2022
[`match_single_binding`] Add curlies for more cases to fix suggestion causes error

Fixes rust-lang#9575

changelog: [`match_single_binding`]: Add curlies for scrutinees with side effects for more cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants