Sitelet https://github.com/dtolnay/syn/pull/2083
Skip to content

docs: note parse_nested_meta must consume non-path args - #2083

Open
SatvikMishra08 wants to merge 1 commit into
dtolnay:masterfrom
SatvikMishra08:docs/1426-parse-nested-meta-consume
Open

SatvikMishra08 wants to merge 1 commit into
dtolnay:masterfrom
SatvikMishra08:docs/1426-parse-nested-meta-consume

Conversation

@SatvikMishra08

Copy link
Copy Markdown

Summary

Attribute::parse_nested_meta returns an error when the closure does not consume non-path nested meta (for example the (N) in align(N)), even if the closure itself returns Ok(()). That requirement was easy to miss from the existing docs.

This adds a short note above the #[repr] example stating that for non-path nested meta the closure must parse the remainder on meta.input, and pointing at the existing align / packed arms as the pattern to follow.

Related

Fixes #1426

Docs-only.

Document that when a nested meta item is not a bare path (e.g. align(N)),
the closure must parse the remainder on meta.input; returning Ok(())
without consuming trailing tokens yields an error.

Fixes dtolnay#1426

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parse_nested_meta docs: mention that error will be returned if closure doesn't parse non-path parts

1 participant