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

Raw identifiers are not supported #63

Closed
pwoolcoc opened this issue Apr 17, 2020 · 0 comments
Closed

Raw identifiers are not supported #63

pwoolcoc opened this issue Apr 17, 2020 · 0 comments

Comments

@pwoolcoc
Copy link

It appears that the Getters derive panics when encountering a raw identifier. The error was reproducible on master as well as the most recently published crates.io version:

± cargo build
   Compiling getset-bug v0.1.0 (/Users/pwoolcock/code/getset-bug)
thread 'rustc' panicked at '`"r#type"` is not a valid identifier', src/librustc_expand/proc_macro_server.rs:329:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (f4c675c47 2020-03-19) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: proc-macro derive panicked
 --> src/lib.rs:3:10
  |
3 | #[derive(Getters)]
  |          ^^^^^^^
  |
  = help: message: `"r#type"` is not a valid identifier

error: aborting due to previous error

error: could not compile `getset-bug`.

To learn more, run the command again with --verbose.

and here's the code I used to generate this error:

use getset::Getters;

#[derive(Getters)]
pub struct Foo {
    r#type: String,
}
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