Strip redundant fields in codegen producing warnings

This commit is contained in:
tyranron 2021-07-21 18:16:29 +03:00
parent 64fb83f5aa
commit ad64025572
No known key found for this signature in database
GPG key ID: 762E144FB230A4F0
54 changed files with 1 additions and 839 deletions

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL enum expects at least one field
--> $DIR/derive_no_fields.rs:2:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `ObjectA: IsInputType<__S>` is not satisfied
--> $DIR/derive_incompatible_object.rs:6:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL input object expects at least one field
--> $DIR/derive_no_fields.rs:2:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/derive_no_underscore.rs:3:15
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL input object does not allow fields with the same name
--> $DIR/derive_unique_name.rs:4:5
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/argument_double_underscored.rs:14:18
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
--> $DIR/argument_non_input_type.rs:16:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL interface trait method `as_obja` conflicts with the external downcast function `downcast_obja` declared on the trait to downcast into the implementer type `ObjA`
--> $DIR/downcast_method_conflicts_with_external_downcast_fn.rs:26:5
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL interface expects trait method to accept `&self` only and, optionally, `&Context`
--> $DIR/downcast_method_wrong_input_args.rs:10:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL interface expects trait method return type to be `Option<&ImplementerType>` only
--> $DIR/downcast_method_wrong_return_type.rs:10:40
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/field_double_underscored.rs:14:8
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied
--> $DIR/field_non_output_return_type.rs:17:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL interface must have a different name for each field
--> $DIR/fields_duplicate.rs:13:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `ObjA: GraphQLObjectType<__S>` is not satisfied
--> $DIR/implementer_non_object_type.rs:15:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: duplicated attribute argument found
--> $DIR/implementers_duplicate_pretty.rs:16:34
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0119]: conflicting implementations of trait `<CharacterValue as juniper::GraphQLInterface<__S>>::mark::_::{closure#0}::MutuallyExclusive` for type `ObjA`
--> $DIR/implementers_duplicate_ugly.rs:18:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/name_double_underscored.rs:4:7
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL interface must have at least one field
--> $DIR/no_fields.rs:13:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: #[graphql_interface] attribute is applicable to trait definitions and trait implementations only
--> $DIR/wrong_item.rs:8:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL object does not allow fields with the same name
--> $DIR/derive_fields_unique.rs:4:5
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL object expects at least one field
--> $DIR/derive_no_fields.rs:2:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/derive_no_underscore.rs:3:15
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `Obj: IsInputType<__S>` is not satisfied
--> $DIR/impl_argument_no_object.rs:8:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL object does not allow fields with the same name
--> $DIR/impl_fields_unique.rs:9:5
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/impl_no_argument_underscore.rs:5:29
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL object expects at least one field
--> $DIR/impl_no_fields.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/impl_no_underscore.rs:5:15
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: #[graphql_union] attribute is applicable to trait definitions only
--> $DIR/attr_wrong_item.rs:3:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union can only be derived for enums and structs
--> $DIR/derive_wrong_item.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union variant `Human` already has external resolver function `resolve_fn1` declared on the enum
--> $DIR/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs:6:15
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/enum_name_double_underscored.rs:4:6
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union expects at least one union variant
--> $DIR/enum_no_fields.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `Test: GraphQLObjectType<__S>` is not satisfied
--> $DIR/enum_non_object_variant.rs:9:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union must have a different type for each union variant
--> $DIR/enum_same_type_pretty.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0119]: conflicting implementations of trait `<Character as juniper::GraphQLUnion<__S>>::mark::_::{closure#0}::MutuallyExclusive` for type `std::string::String`
--> $DIR/enum_same_type_ugly.rs:3:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union enum allows only unnamed variants with a single field, e.g. `Some(T)`
--> $DIR/enum_wrong_variant_field.rs:5:5
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/struct_name_double_underscored.rs:5:8
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union expects at least one union variant
--> $DIR/struct_no_fields.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `Test: GraphQLObjectType<__S>` is not satisfied
--> $DIR/struct_non_object_variant.rs:9:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: duplicated attribute argument found
--> $DIR/struct_same_type_pretty.rs:5:14
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0119]: conflicting implementations of trait `<Character as juniper::GraphQLUnion<__S>>::mark::_::{closure#0}::MutuallyExclusive` for type `std::string::String`
--> $DIR/struct_same_type_ugly.rs:3:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `CustomContext: FromContext<SubContext>` is not satisfied
--> $DIR/trait_fail_infer_context.rs:3:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union trait method `a` conflicts with the external resolver function `some_fn` declared on the trait to resolve the variant type `Human`
--> $DIR/trait_method_conflicts_with_external_resolver_fn.rs:5:5
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: All types and directives defined within a schema must not have a name which begins with `__` (two underscores), as this is used exclusively by GraphQLs introspection system.
--> $DIR/trait_name_double_underscored.rs:4:7
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union expects at least one union variant
--> $DIR/trait_no_fields.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0277]: the trait bound `Test: GraphQLObjectType<__S>` is not satisfied
--> $DIR/trait_non_object_variant.rs:9:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union must have a different type for each union variant
--> $DIR/trait_same_type_pretty.rs:4:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error[E0119]: conflicting implementations of trait `<(dyn Character + std::marker::Send + std::marker::Sync + '__obj) as juniper::GraphQLUnion<__S>>::mark::_::{closure#0}::MutuallyExclusive` for type `std::string::String`
--> $DIR/trait_same_type_ugly.rs:3:1
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union cannot use #[graphql(with = ...)] attribute on a trait method
--> $DIR/trait_with_attr_on_method.rs:5:15
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union expects trait method to accept `&self` only and, optionally, `&Context`
--> $DIR/trait_wrong_method_input_args.rs:5:10
|

View file

@ -1,19 +1,3 @@
warning: field is never read: `enum_path`
--> $DIR/mod.rs:282:5
|
282 | pub enum_path: Option<TokenStream>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field is never read: `span`
--> $DIR/mod.rs:296:5
|
296 | pub span: Span,
| ^^^^^^^^^^^^^^
warning: 2 warnings emitted
error: GraphQL union expects trait method return type to be `Option<&VariantType>` only
--> $DIR/trait_wrong_method_return_type.rs:5:20
|

View file

@ -206,8 +206,6 @@ fn parse_variant_from_trait_method(
ty,
resolver_code,
resolver_check,
enum_path: None,
context_ty: method_context_ty,
span: method_span,
})
}

View file

@ -105,7 +105,6 @@ fn parse_variant_from_enum_variant(
return None;
}
let var_span = var.span();
let var_ident = var.ident;
let ty = match var.fields {
@ -161,9 +160,7 @@ fn parse_variant_from_enum_variant(
ty,
resolver_code,
resolver_check,
enum_path: Some(enum_path),
context_ty: None,
span: var_span,
})
}

View file

@ -7,7 +7,7 @@ pub mod derive;
use std::collections::HashMap;
use proc_macro2::{Span, TokenStream};
use proc_macro2::TokenStream;
use quote::{quote, ToTokens, TokenStreamExt as _};
use syn::{
parse::{Parse, ParseStream},
@ -274,13 +274,6 @@ struct UnionVariantDefinition {
/// [1]: https://spec.graphql.org/June2018/#sec-Unions
pub resolver_check: syn::Expr,
/// Rust enum variant path that this [GraphQL union][1] variant is associated with.
///
/// It's available only when code generation happens for Rust enums.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Unions
pub enum_path: Option<TokenStream>,
/// Rust type of `juniper::Context` that this [GraphQL union][1] variant requires for
/// resolution.
///
@ -289,11 +282,6 @@ struct UnionVariantDefinition {
///
/// [1]: https://spec.graphql.org/June2018/#sec-Unions
pub context_ty: Option<syn::Type>,
/// [`Span`] that points to the Rust source code which defines this [GraphQL union][1] variant.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Unions
pub span: Span,
}
/// Definition of [GraphQL union][1] for code generation.
@ -605,8 +593,6 @@ fn emerge_union_variants_from_meta(
}
for (ty, rslvr) in external_resolvers {
let span = rslvr.span_joined();
let resolver_fn = rslvr.into_inner();
let resolver_code = parse_quote! {
#resolver_fn(self, ::juniper::FromContext::from(context))
@ -621,15 +607,12 @@ fn emerge_union_variants_from_meta(
if let Some(var) = variants.iter_mut().find(|v| v.ty == ty) {
var.resolver_code = resolver_code;
var.resolver_check = resolver_check;
var.span = span;
} else {
variants.push(UnionVariantDefinition {
ty,
resolver_code,
resolver_check,
enum_path: None,
context_ty: None,
span,
})
}
}