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

extern crate foo as bar; gives outdated & unhelpful error message #17709

Closed
huonw opened this issue Oct 2, 2014 · 1 comment
Closed

extern crate foo as bar; gives outdated & unhelpful error message #17709

huonw opened this issue Oct 2, 2014 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@huonw
Copy link
Member

huonw commented Oct 2, 2014

extern crate foo as bar;

Fails to compile with:

<anon>:1:18: 1:20 error: expected one of `=`, `;`, found `as`
<anon>:1 extern crate foo as bar;
                          ^~

The problem is the foo currently needs to be a string: extern crate "foo" as bar. The error message is referring to = still (the old syntax), and it could easily be improved to say "maybe you meant to enclose foo in a string".

@huonw huonw added the A-diagnostics Area: Messages for errors, warnings, and lints label Oct 2, 2014
@gamazeps
Copy link
Contributor

gamazeps commented Oct 4, 2014

Done ;)

gamazeps pushed a commit to gamazeps/rust that referenced this issue Oct 12, 2014
bors added a commit that referenced this issue Oct 13, 2014
I did not put the crate name in the error note, if that's necessary I'll look into it.

Closes #17709
@bors bors closed this as completed in e69f2ab Oct 13, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Jul 28, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants