Skip to content

Attributes used with derive have incorrect span information #47941

Closed
@sgrif

Description

@sgrif

Given the following struct:

#[derive(AsChangeset)]
#[table_name = "users"]
struct UserForm {
    id: i32,
    name: String,
}

the input to the custom derive will have incorrect span information for every token in the table_name attribute except for the pound. Every other token will have the span Span { lo: BytePos(0), hi: BytePos(0), ctxt: #0 }.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-decl-macros-1-2Area: Declarative macros 1.2A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions