File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ mod polyfill {
255255 }
256256
257257 thread_local ! {
258- static ENTERED_ENTRY_POINT : Cell <usize > = Cell :: new( 0 ) ;
258+ static ENTERED_ENTRY_POINT : Cell <usize > = const { Cell :: new( 0 ) } ;
259259 }
260260
261261 /// This is the entry point for a macro to support [`Diagnostic`]s.
@@ -312,7 +312,7 @@ mod polyfill {
312312 }
313313
314314 thread_local ! {
315- static ERR_STORAGE : RefCell <Vec <Diagnostic >> = RefCell :: new( Vec :: new( ) ) ;
315+ static ERR_STORAGE : RefCell <Vec <Diagnostic >> = const { RefCell :: new( Vec :: new( ) ) } ;
316316 }
317317
318318 /// Emits the provided [`Diagnostic`], while not aborting macro execution.
Original file line number Diff line number Diff line change @@ -450,14 +450,14 @@ enum Field {
450450 Named ( syn:: Field ) ,
451451
452452 /// Unnamed [`Field`].
453- Unnamed ( syn :: Field ) ,
453+ Unnamed ,
454454}
455455
456456impl ToTokens for Field {
457457 fn to_tokens ( & self , tokens : & mut TokenStream ) {
458458 match self {
459459 Self :: Named ( f) => f. ident . to_tokens ( tokens) ,
460- Self :: Unnamed ( _ ) => tokens. append ( Literal :: u8_unsuffixed ( 0 ) ) ,
460+ Self :: Unnamed => tokens. append ( Literal :: u8_unsuffixed ( 0 ) ) ,
461461 }
462462 }
463463}
@@ -470,9 +470,7 @@ impl TryFrom<syn::Fields> for Field {
470470 syn:: Fields :: Named ( mut f) if f. named . len ( ) == 1 => {
471471 Ok ( Self :: Named ( f. named . pop ( ) . unwrap ( ) . into_value ( ) ) )
472472 }
473- syn:: Fields :: Unnamed ( mut f) if f. unnamed . len ( ) == 1 => {
474- Ok ( Self :: Unnamed ( f. unnamed . pop ( ) . unwrap ( ) . into_value ( ) ) )
475- }
473+ syn:: Fields :: Unnamed ( f) if f. unnamed . len ( ) == 1 => Ok ( Self :: Unnamed ) ,
476474 _ => Err ( ERR . custom_error ( value. span ( ) , "expected exactly 1 field" ) ) ,
477475 }
478476 }
@@ -483,7 +481,7 @@ impl Field {
483481 fn match_arg ( & self ) -> TokenStream {
484482 match self {
485483 Self :: Named ( _) => quote ! { { #self : v } } ,
486- Self :: Unnamed ( _ ) => quote ! { ( v) } ,
484+ Self :: Unnamed => quote ! { ( v) } ,
487485 }
488486 }
489487}
Original file line number Diff line number Diff line change @@ -900,7 +900,7 @@ mod bounded_generic_scalar {
900900mod explicit_custom_context {
901901 use super :: * ;
902902
903- struct CustomContext ( prelude:: String ) ;
903+ struct CustomContext ( # [ allow ( dead_code ) ] prelude:: String ) ;
904904
905905 impl juniper:: Context for CustomContext { }
906906
Original file line number Diff line number Diff line change @@ -1097,7 +1097,7 @@ mod external_resolver_enum_variant {
10971097 enum Character {
10981098 A ( Human ) ,
10991099 #[ graphql( with = Character :: as_droid) ]
1100- B ( Droid ) ,
1100+ B ( # [ allow ( dead_code ) ] Droid ) ,
11011101 }
11021102
11031103 impl Character {
You can’t perform that action at this time.
0 commit comments