File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
proc_macro_example_derive/src Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ use crate::prelude::*;
3131/// }// ^------ This enum will capture the `Union` variant since it's a `union`.
3232/// ```
3333pub enum ReflectiveInputType < ' a > {
34+ /// Captures a `struct`'s fields. This isn't [`FieldsNamed`] due to the existence tuple structs.
3435 Fields ( & ' a Fields ) ,
35- // `syn::punctuated::Punctuated` is also a type that saves boilerplate. For a declarative macro
36- // equivalent it'd be parsing: `$($x:Variant),+ $(,)?` (if declarative macros had `Variant` as
37- // a fragment specifier that is). This extra comma token makes it so there could or could not
38- // be one more type after the last comma token parsed. We take these things for granted as
39- // users but this has to be addressed while we're parsing Rust code.
36+ /// [ `syn::punctuated::Punctuated`] is also a type that saves boilerplate. For a declarative macro
37+ /// equivalent it'd be parsing: `$($x:Variant),+ $(,)?` (if declarative macros had `Variant` as
38+ /// a fragment specifier that is). This extra comma token makes it so there could or could not
39+ /// be one more type after the last comma token parsed. We take these things for granted as
40+ /// users but this has to be addressed while we're parsing Rust code.
4041 Variants ( & ' a Punctuated < Variant , Token ! [ , ] > ) ,
42+ /// Unlike `struct`'s, unions are forced to have named fields, thus using [`FieldsNamed`].
4143 UnionFields ( & ' a FieldsNamed ) ,
4244}
4345
You can’t perform that action at this time.
0 commit comments