Skip to content

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

Closed
@huonw

Description

@huonw
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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions