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

Display error message if mistype macro_use #49074

Closed
QuantumBear opened this issue Mar 16, 2018 · 0 comments · Fixed by #49077
Closed

Display error message if mistype macro_use #49074

QuantumBear opened this issue Mar 16, 2018 · 0 comments · Fixed by #49077

Comments

@QuantumBear
Copy link

QuantumBear commented Mar 16, 2018

I typed #[marco_use] instead of correct #[macro_use] in file, but the compiler report can not find macro xxx in this scope.

extern crate iron;
#[marco_use] extern crate mime;

and the error message is

error: cannot find macro `mime!` in this scope
  --> src/main.rs:15:22
   |
15 |     response.set_mut(mime!(Text/Html; Charset=Utf8));
   |                      ^^^^

I think compiler should directly report marco_use is incorrect and should be macro_use.

##Meta

rustc 1.22.1 (05e2e1c 2017-11-22)
binary: rustc
commit-hash: 05e2e1c
commit-date: 2017-11-22
host: x86_64-unknown-linux-gnu
release: 1.22.1
LLVM version: 4.0

kennytm added a commit to kennytm/rust that referenced this issue Mar 17, 2018
Checks for unknown attributes before aborting due to unresolved macros

Fixes rust-lang#49074

The ``attribute `...` is currently unknown to the compiler`` error was not shown if there are any unresolved macros, which might be caused by mistyped `macro_use`.
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

Successfully merging a pull request may close this issue.

1 participant