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

Confusing error message: "can't qualify macro invocation with pub" when struct keyword missing #55403

Closed
jimblandy opened this issue Oct 26, 2018 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@jimblandy
Copy link
Contributor

The program:

pub LexicalEnv<'a>

elicits the confusing error message:

error: can't qualify macro invocation with `pub`
 --> src/lib.rs:1:1
  |
1 | pub LexicalEnv<'a>
  | ^^^
  |
  = help: try adjusting the macro to put `pub` inside the invocation

error: expected one of `!` or `::`, found `<`
 --> src/lib.rs:1:15
  |
1 | pub LexicalEnv<'a>
  |               ^ expected one of `!` or `::` here

Similar issues have been filed before (#40006 and #38911, at least), and were not closed with an indication that the problem wasn't expected to be fixed, so I'm going ahead and filing this. This specific case was mentioned in a comment by @fschutt.

@csmoe csmoe added the A-diagnostics Area: Messages for errors, warnings, and lints label Oct 27, 2018
Centril added a commit to Centril/rust that referenced this issue Dec 8, 2018
…henkov

Suggest an appropriate token when encountering `pub Ident<'a>`

Fix rust-lang#55403. Follow up to rust-lang#45997.
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

No branches or pull requests

2 participants