Skip to content

State proc_macro panics on struct with type field #140

@s9tpepper

Description

@s9tpepper

What happened
The #[derive(State)] proc macro panics if the struct contains a field named "r#type"

What did you expect to happen
The proc macro should not panic on a valid field name.

Steps to reproduce
Steps to reproduce the behaviour:
Try deriving state like this:

#[derive(State)]
struct Test {
    r#type: Value<String>,
}

Causes:

proc-macro derive panicked
message: `"r#type"` is not a valid identifier
proc-macro panicked: `"r#type"` is not a valid identifier [macro-error]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions