Skip to content

Conversation

@nertpinx
Copy link

Similarly to #93 which fixes compilation with unknown/external attributes in the legacy branch, this is a similar approach but for the implementation using syn crate as requested by @BennoLossin in #93 .

I am slightly unsure about few things:

  • Is there maybe another attribute that's worth keeping around instead of filtering?
  • Does it make sense to keep the #[cfg] attribute since it might be filtered out before the macro runs?
  • Naming (classic) and commit subjects are probably sub-par.

This is also created against the dev/syn2 branch so that it applies there or after #89 . Don't hesitate to let me know if I missed anything anywhere (highly likely). Thanks

This way any future modification into what attributes should be kept can
be made in one place rather than chasing all the places where attributes
are being filtered.

Signed-off-by: Martin Kletzander <[email protected]>
This allows the usage of dummy attributes in tests.

Signed-off-by: Martin Kletzander <[email protected]>
Instead of keeping all the member attributes, which might not even make
sense for anything else than struct members, keep only those that we're
either interested in or might alter the behaviour of the code.

This is tested with a new test which illustrates the pre-existing issue
where struct might use various attributes for its members which can be
valid, but would (before this patch) fail to compile.

Signed-off-by: Martin Kletzander <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant