TedDriggs / darling

A Rust proc-macro attribute parser
MIT License
983 stars 66 forks source link

Fix some missing syn invisible group handling in FromMeta implementations #263

Closed Ten0 closed 7 months ago

Ten0 commented 7 months ago

This was supposed to be fixed by c03616225175831db83a0b84b5866253f4d8ab43 but it looks like these implementations were forgotten.

Ten0 commented 7 months ago

As of syn 2.40, syn may generate this invisible token when the input to the darling proc macro (specifically, the attributes) are generated by a macro_rules! (e.g. propagating a macro_rules!'s expr), so this doesn't fit well within the existing test framework (as there would have to be tests for a crate that expands a such macro, that depends on the proc_macro user crate that depends on darling's macro crate). However I did test that this resolves the parsing issue in such cases (We're actually relying on a fork for this ATM). A similar breakage happened within Diesel: https://github.com/diesel-rs/diesel/pull/3873

TedDriggs commented 7 months ago

Okay, can you add that as a comment in the source code with each of these changes so that it's clear later why this is going on?