Skip to content

Remove special case for BindingPattern in GetSpan codegen #3904

@overlookmotel

Description

@overlookmotel

As discussed in #3900 (comment), it'd be preferable in my view to remove the "special case" code for BindingPattern from GetSpan codegen.

I propose instead adding a #[span] attr to the kind field, and codegen can act on that to generate:

impl<'a> GetSpan for BindingPattern<'a> {
    #[inline]
    fn span(&self) -> Span {
        self.kind.span()
    }
}

We can then use that same #[span] mechanism if it's required for any other types in future.

Metadata

Metadata

Assignees

Labels

A-astArea - ASTC-cleanupCategory - technical debt or refactoring. Solution not expected to change behavior

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions