@@ -253,33 +253,33 @@ macro_rules! define_invoke_proc_macro {
253253 #[ doc( hidden) ]
254254 #[ macro_export]
255255 macro_rules! $macro_name {
256- ( $proc_macro_name: ident ! $paren: tt) => {
257- #[ derive( $proc_macro_name) ]
258- #[ allow( unused) ]
259- enum ProceduralMasqueradeDummyType {
260- // The magic happens here.
261- //
262- // We use an `enum` with an explicit discriminant
263- // because that is the only case where a type definition
264- // can contain a (const) expression.
265- //
266- // `(0, "foo").0` evalutes to 0, with the `"foo"` part ignored.
267- //
268- // By the time the `#[proc_macro_derive]` function
269- // implementing `#[derive($proc_macro_name)]` is called,
270- // `$paren` has already been replaced with the input of this inner macro,
271- // but `stringify!` has not been expanded yet.
272- //
273- // This how arbitrary tokens can be inserted
274- // in the input to the `#[proc_macro_derive]` function.
275- //
276- // Later, `stringify!(...)` is expanded into a string literal
277- // which is then ignored.
278- // Using `stringify!` enables passing arbitrary tokens
279- // rather than only what can be parsed as a const expression.
280- Input = ( 0 , stringify! $paren ) . 0 ,
256+ ( $proc_macro_name: ident ! $paren: tt) => {
257+ #[ derive( $proc_macro_name) ]
258+ #[ allow( unused) ]
259+ enum ProceduralMasqueradeDummyType {
260+ // The magic happens here.
261+ //
262+ // We use an `enum` with an explicit discriminant
263+ // because that is the only case where a type definition
264+ // can contain a (const) expression.
265+ //
266+ // `(0, "foo").0` evalutes to 0, with the `"foo"` part ignored.
267+ //
268+ // By the time the `#[proc_macro_derive]` function
269+ // implementing `#[derive($proc_macro_name)]` is called,
270+ // `$paren` has already been replaced with the input of this inner macro,
271+ // but `stringify!` has not been expanded yet.
272+ //
273+ // This how arbitrary tokens can be inserted
274+ // in the input to the `#[proc_macro_derive]` function.
275+ //
276+ // Later, `stringify!(...)` is expanded into a string literal
277+ // which is then ignored.
278+ // Using `stringify!` enables passing arbitrary tokens
279+ // rather than only what can be parsed as a const expression.
280+ Input = ( 0 , stringify! $paren ) . 0 ,
281+ }
282+ }
281283 }
282- }
283- }
284284 } ;
285285}
0 commit comments