Skip to content

Incorrect "no such field" error #5147

@SamRodri

Description

@SamRodri

In the latest version (v0.2.224) this code causes the incorrect error:

macro_rules! Type {
    () => { u32 };
}

struct Foo {
    bar: Type![],
}
impl Foo {
    fn new() -> Self {
        Foo {
            bar: 0 // <- incorrect error here
        }
    }
}

I first encountered this using the syn Token! macro.

Metadata

Metadata

Labels

A-macromacro expansion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions