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