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

[Rust 2018] cannot use pest #[grammar = "..."] without #[macro_use] extern crate pest_derive; #55735

Closed
lucatrv opened this issue Nov 6, 2018 · 2 comments

Comments

@lucatrv
Copy link

lucatrv commented Nov 6, 2018

As in subject, I understood that with Rust 2018:

#[macro_use] extern crate pest_derive;

should not be required anymore, as reported here:
https://rust-lang-nursery.github.io/edition-guide/rust-2018/macros/macro-changes.html

However, without that statement, the following code fails to compile:

#[derive(Parser)]
#[grammar = "csv.pest"]
pub struct CSVParser;

with error:

error[E0658]: The attribute grammar is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)

@steveklabnik
Copy link
Member

Did you

use pest_derive::Parser;

?

@lucatrv
Copy link
Author

lucatrv commented Nov 6, 2018

Sorry, I just did:

use pest::Parser;

Thanks for your hint

@lucatrv lucatrv closed this as completed Nov 6, 2018
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

No branches or pull requests

2 participants