From ad640255724a73f966e5080d81218424042993cd Mon Sep 17 00:00:00 2001 From: tyranron Date: Wed, 21 Jul 2021 18:16:29 +0300 Subject: [PATCH] Strip redundant fields in codegen producing warnings --- .../fail/enum/derive_no_fields.stderr | 16 ---------------- .../derive_incompatible_object.stderr | 16 ---------------- .../fail/input-object/derive_no_fields.stderr | 16 ---------------- .../input-object/derive_no_underscore.stderr | 16 ---------------- .../input-object/derive_unique_name.stderr | 16 ---------------- .../argument_double_underscored.stderr | 16 ---------------- .../interface/argument_non_input_type.stderr | 16 ---------------- ...conflicts_with_external_downcast_fn.stderr | 16 ---------------- .../downcast_method_wrong_input_args.stderr | 16 ---------------- .../downcast_method_wrong_return_type.stderr | 16 ---------------- .../interface/field_double_underscored.stderr | 16 ---------------- .../field_non_output_return_type.stderr | 16 ---------------- .../fail/interface/fields_duplicate.stderr | 16 ---------------- .../implementer_non_object_type.stderr | 16 ---------------- .../implementers_duplicate_pretty.stderr | 16 ---------------- .../implementers_duplicate_ugly.stderr | 16 ---------------- .../interface/name_double_underscored.stderr | 16 ---------------- .../fail/interface/no_fields.stderr | 16 ---------------- .../fail/interface/wrong_item.stderr | 16 ---------------- .../fail/object/derive_fields_unique.stderr | 16 ---------------- .../fail/object/derive_no_fields.stderr | 16 ---------------- .../fail/object/derive_no_underscore.stderr | 16 ---------------- .../object/impl_argument_no_object.stderr | 16 ---------------- .../fail/object/impl_fields_unique.stderr | 16 ---------------- .../object/impl_no_argument_underscore.stderr | 16 ---------------- .../fail/object/impl_no_fields.stderr | 16 ---------------- .../fail/object/impl_no_underscore.stderr | 16 ---------------- .../fail/union/attr_wrong_item.stderr | 16 ---------------- .../fail/union/derive_wrong_item.stderr | 16 ---------------- ...s_with_variant_external_resolver_fn.stderr | 16 ---------------- .../union/enum_name_double_underscored.stderr | 16 ---------------- .../fail/union/enum_no_fields.stderr | 16 ---------------- .../fail/union/enum_non_object_variant.stderr | 16 ---------------- .../fail/union/enum_same_type_pretty.stderr | 16 ---------------- .../fail/union/enum_same_type_ugly.stderr | 16 ---------------- .../union/enum_wrong_variant_field.stderr | 16 ---------------- .../struct_name_double_underscored.stderr | 16 ---------------- .../fail/union/struct_no_fields.stderr | 16 ---------------- .../union/struct_non_object_variant.stderr | 16 ---------------- .../fail/union/struct_same_type_pretty.stderr | 16 ---------------- .../fail/union/struct_same_type_ugly.stderr | 16 ---------------- .../union/trait_fail_infer_context.stderr | 16 ---------------- ...conflicts_with_external_resolver_fn.stderr | 16 ---------------- .../trait_name_double_underscored.stderr | 16 ---------------- .../fail/union/trait_no_fields.stderr | 16 ---------------- .../union/trait_non_object_variant.stderr | 16 ---------------- .../fail/union/trait_same_type_pretty.stderr | 16 ---------------- .../fail/union/trait_same_type_ugly.stderr | 16 ---------------- .../union/trait_with_attr_on_method.stderr | 16 ---------------- .../trait_wrong_method_input_args.stderr | 16 ---------------- .../trait_wrong_method_return_type.stderr | 16 ---------------- juniper_codegen/src/graphql_union/attr.rs | 2 -- juniper_codegen/src/graphql_union/derive.rs | 3 --- juniper_codegen/src/graphql_union/mod.rs | 19 +------------------ 54 files changed, 1 insertion(+), 839 deletions(-) diff --git a/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr b/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr index 1c9238f7..ccfc4951 100644 --- a/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr b/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr index e86e7f91..988fbab5 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr b/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr index 45d2fed2..88329232 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr b/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr index 62bea978..eb7eb67b 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/derive_no_underscore.rs:3:15 | diff --git a/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr b/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr index fcc78329..ccecaf48 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr b/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr index 708b12f5..f06c385c 100644 --- a/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/interface/argument_double_underscored.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/argument_double_underscored.rs:14:18 | diff --git a/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr b/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr index 95c219d0..131e43e2 100644 --- a/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/argument_non_input_type.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr b/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr index ee167360..a8abef2d 100644 --- a/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr +++ b/integration_tests/codegen_fail/fail/interface/downcast_method_conflicts_with_external_downcast_fn.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr index 9bbfbba4..718a0a25 100644 --- a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr +++ b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_input_args.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr index 36f90b81..8c459495 100644 --- a/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/downcast_method_wrong_return_type.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr b/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr index 25c13c59..adebb09f 100644 --- a/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/interface/field_double_underscored.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/field_double_underscored.rs:14:8 | diff --git a/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr index 7d319afe..0ebe0fa2 100644 --- a/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/field_non_output_return_type.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr b/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr index 44f6a698..db133386 100644 --- a/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr +++ b/integration_tests/codegen_fail/fail/interface/fields_duplicate.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr b/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr index 9b2542f8..e4e09b66 100644 --- a/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr +++ b/integration_tests/codegen_fail/fail/interface/implementer_non_object_type.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/implementers_duplicate_pretty.stderr b/integration_tests/codegen_fail/fail/interface/implementers_duplicate_pretty.stderr index dce26278..40db273e 100644 --- a/integration_tests/codegen_fail/fail/interface/implementers_duplicate_pretty.stderr +++ b/integration_tests/codegen_fail/fail/interface/implementers_duplicate_pretty.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/implementers_duplicate_ugly.stderr b/integration_tests/codegen_fail/fail/interface/implementers_duplicate_ugly.stderr index e71aecd8..d06dda36 100644 --- a/integration_tests/codegen_fail/fail/interface/implementers_duplicate_ugly.stderr +++ b/integration_tests/codegen_fail/fail/interface/implementers_duplicate_ugly.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 `>::mark::_::{closure#0}::MutuallyExclusive` for type `ObjA` --> $DIR/implementers_duplicate_ugly.rs:18:1 | diff --git a/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr b/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr index ce9cefa0..de8c6715 100644 --- a/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/interface/name_double_underscored.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/name_double_underscored.rs:4:7 | diff --git a/integration_tests/codegen_fail/fail/interface/no_fields.stderr b/integration_tests/codegen_fail/fail/interface/no_fields.stderr index 1c83db3c..367a5e9b 100644 --- a/integration_tests/codegen_fail/fail/interface/no_fields.stderr +++ b/integration_tests/codegen_fail/fail/interface/no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/interface/wrong_item.stderr b/integration_tests/codegen_fail/fail/interface/wrong_item.stderr index 7a8c4082..a86b15c2 100644 --- a/integration_tests/codegen_fail/fail/interface/wrong_item.stderr +++ b/integration_tests/codegen_fail/fail/interface/wrong_item.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/object/derive_fields_unique.stderr b/integration_tests/codegen_fail/fail/object/derive_fields_unique.stderr index 666a2d0a..999b0116 100644 --- a/integration_tests/codegen_fail/fail/object/derive_fields_unique.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_fields_unique.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr b/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr index db218167..183cd430 100644 --- a/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/object/derive_no_underscore.stderr b/integration_tests/codegen_fail/fail/object/derive_no_underscore.stderr index 62bea978..eb7eb67b 100644 --- a/integration_tests/codegen_fail/fail/object/derive_no_underscore.stderr +++ b/integration_tests/codegen_fail/fail/object/derive_no_underscore.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/derive_no_underscore.rs:3:15 | diff --git a/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr b/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr index b98e7e05..38468608 100644 --- a/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr +++ b/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/object/impl_fields_unique.stderr b/integration_tests/codegen_fail/fail/object/impl_fields_unique.stderr index 01e75168..49649a2a 100644 --- a/integration_tests/codegen_fail/fail/object/impl_fields_unique.stderr +++ b/integration_tests/codegen_fail/fail/object/impl_fields_unique.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/object/impl_no_argument_underscore.stderr b/integration_tests/codegen_fail/fail/object/impl_no_argument_underscore.stderr index b4f10e5a..40eea80d 100644 --- a/integration_tests/codegen_fail/fail/object/impl_no_argument_underscore.stderr +++ b/integration_tests/codegen_fail/fail/object/impl_no_argument_underscore.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/impl_no_argument_underscore.rs:5:29 | diff --git a/integration_tests/codegen_fail/fail/object/impl_no_fields.stderr b/integration_tests/codegen_fail/fail/object/impl_no_fields.stderr index 7e7e6059..798a7db2 100644 --- a/integration_tests/codegen_fail/fail/object/impl_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/object/impl_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/object/impl_no_underscore.stderr b/integration_tests/codegen_fail/fail/object/impl_no_underscore.stderr index 96c8a533..b7e531e5 100644 --- a/integration_tests/codegen_fail/fail/object/impl_no_underscore.stderr +++ b/integration_tests/codegen_fail/fail/object/impl_no_underscore.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/impl_no_underscore.rs:5:15 | diff --git a/integration_tests/codegen_fail/fail/union/attr_wrong_item.stderr b/integration_tests/codegen_fail/fail/union/attr_wrong_item.stderr index bf16d8c3..2a6d3ae0 100644 --- a/integration_tests/codegen_fail/fail/union/attr_wrong_item.stderr +++ b/integration_tests/codegen_fail/fail/union/attr_wrong_item.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr b/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr index c0c7b73a..fdeb15b4 100644 --- a/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr +++ b/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr b/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr index f35ab1c0..12957f13 100644 --- a/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr index 5d8610c9..df5db23f 100644 --- a/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/enum_name_double_underscored.rs:4:6 | diff --git a/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr b/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr index 1b6253dd..85ea2585 100644 --- a/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr index f4b871bd..3cb23c26 100644 --- a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr b/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr index cc86a17d..65cac9c3 100644 --- a/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr b/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr index 9425d7a3..fbb313ad 100644 --- a/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 `>::mark::_::{closure#0}::MutuallyExclusive` for type `std::string::String` --> $DIR/enum_same_type_ugly.rs:3:10 | diff --git a/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr b/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr index f34ea33b..4f5def6a 100644 --- a/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr index fec65cf5..48054c63 100644 --- a/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/struct_name_double_underscored.rs:5:8 | diff --git a/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr b/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr index e1303d27..3d6aaeb2 100644 --- a/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr index 588a1c80..8981bacf 100644 --- a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_pretty.stderr b/integration_tests/codegen_fail/fail/union/struct_same_type_pretty.stderr index f6e069e1..9e3152bd 100644 --- a/integration_tests/codegen_fail/fail/union/struct_same_type_pretty.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_same_type_pretty.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr b/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr index bf4f46a0..48a91be2 100644 --- a/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 `>::mark::_::{closure#0}::MutuallyExclusive` for type `std::string::String` --> $DIR/struct_same_type_ugly.rs:3:10 | diff --git a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr b/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr index 958a7249..9279a9b3 100644 --- a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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` is not satisfied --> $DIR/trait_fail_infer_context.rs:3:1 | diff --git a/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr b/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr index b5eb6db0..6fff3782 100644 --- a/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr b/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr index 4ed665b0..d010fee2 100644 --- a/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 GraphQL’s introspection system. --> $DIR/trait_name_double_underscored.rs:4:7 | diff --git a/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr b/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr index 341c60ab..8261623d 100644 --- a/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr index 8c8bce6f..95cb302b 100644 --- a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr b/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr index f9259408..f899e307 100644 --- a/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr b/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr index fbf25a13..9b7eabbd 100644 --- a/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr b/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr index 812052c9..427163a8 100644 --- a/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr b/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr index 8818943d..9b2fa2d8 100644 --- a/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr b/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr index 615ec244..bbc40568 100644 --- a/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr @@ -1,19 +1,3 @@ -warning: field is never read: `enum_path` - --> $DIR/mod.rs:282:5 - | -282 | pub enum_path: Option, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 | diff --git a/juniper_codegen/src/graphql_union/attr.rs b/juniper_codegen/src/graphql_union/attr.rs index e2de49e5..c2617d1d 100644 --- a/juniper_codegen/src/graphql_union/attr.rs +++ b/juniper_codegen/src/graphql_union/attr.rs @@ -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, }) } diff --git a/juniper_codegen/src/graphql_union/derive.rs b/juniper_codegen/src/graphql_union/derive.rs index 9d5ac7ff..161ddf6a 100644 --- a/juniper_codegen/src/graphql_union/derive.rs +++ b/juniper_codegen/src/graphql_union/derive.rs @@ -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, }) } diff --git a/juniper_codegen/src/graphql_union/mod.rs b/juniper_codegen/src/graphql_union/mod.rs index 28586e37..d3454170 100644 --- a/juniper_codegen/src/graphql_union/mod.rs +++ b/juniper_codegen/src/graphql_union/mod.rs @@ -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, - /// 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, - - /// [`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, }) } }