We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
extern
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
This is a very minor bit of polish, but I bumped into it. Given the following syntactically invalid code:
extern crte hyper; fn main() { println!("hello world") }
rustc produces the error:
$ rustc foo.rs foo.rs:1:8: 1:12 error: expected `{` or `fn`, found `crte` foo.rs:1 extern crte hyper; ^~~~
Ideally, the syntax error message would suggest crate in this instance too.
crate
Whilst there are other tokens that can occur after extern (such as strings), I think crate is sufficiently common to warrant an explicit mention.
The text was updated successfully, but these errors were encountered:
Clarify the error message for malformed extern crate statements
extern crate
dadac15
Closes rust-lang#25468.
Auto merge of #25487 - P1start:extern-crate-unexpected-error, r=huonw
8fdb3a4
Closes #25468.
Successfully merging a pull request may close this issue.
This is a very minor bit of polish, but I bumped into it. Given the following syntactically invalid code:
rustc produces the error:
Ideally, the syntax error message would suggest
crate
in this instance too.Whilst there are other tokens that can occur after
extern
(such as strings), I thinkcrate
is sufficiently common to warrant an explicit mention.The text was updated successfully, but these errors were encountered: