From 8a7d1ffd10fc6d728cb24b17d29752dcf499cb30 Mon Sep 17 00:00:00 2001 From: tyranron Date: Thu, 16 Nov 2023 21:00:53 +0100 Subject: [PATCH] Fix codegen tests for latest stable Rust --- .../derive_incompatible_field_type.stderr | 79 ++++++++++--------- .../attr_field_non_output_return_type.stderr | 30 +++---- ...derive_field_non_output_return_type.stderr | 30 +++---- .../trait/argument_non_input_type.stderr | 48 +++++------ .../trait/field_non_output_return_type.stderr | 30 +++---- .../object/argument_non_input_type.stderr | 25 +++++- .../attr_field_non_output_return_type.stderr | 6 +- ...derive_field_non_output_return_type.stderr | 30 +++---- .../argument_non_input_type.stderr | 25 +++++- .../field_non_output_return_type.stderr | 6 +- .../fail/union/enum_non_object_variant.stderr | 31 ++++---- .../union/struct_non_object_variant.stderr | 31 ++++---- .../union/trait_non_object_variant.stderr | 31 ++++---- 13 files changed, 220 insertions(+), 182 deletions(-) diff --git a/tests/codegen/fail/input-object/derive_incompatible_field_type.stderr b/tests/codegen/fail/input-object/derive_incompatible_field_type.stderr index 46abf94a7..21bf40147 100644 --- a/tests/codegen/fail/input-object/derive_incompatible_field_type.stderr +++ b/tests/codegen/fail/input-object/derive_incompatible_field_type.stderr @@ -1,46 +1,47 @@ error[E0277]: the trait bound `ObjectA: IsInputType<__S>` is not satisfied - --> fail/input-object/derive_incompatible_field_type.rs:8:10 - | -8 | #[derive(GraphQLInputObject)] - | ^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA` - | - = help: the following other types implement trait `IsInputType`: - > - > - > - > - as IsInputType> - > - > - > - and $N others - = note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/input-object/derive_incompatible_field_type.rs:10:12 + | +10 | field: ObjectA, + | ^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA` + | + = help: the following other types implement trait `IsInputType`: + > + > + > + > + as IsInputType> + > + > + > + and $N others error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied - --> fail/input-object/derive_incompatible_field_type.rs:8:10 - | -8 | #[derive(GraphQLInputObject)] - | ^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA` - | - = help: the following other types implement trait `FromInputValue`: - > - > - > - > - as FromInputValue> - > - > - > - and $N others + --> fail/input-object/derive_incompatible_field_type.rs:10:12 + | +8 | #[derive(GraphQLInputObject)] + | ------------------ required by a bound introduced by this call +9 | struct Object { +10 | field: ObjectA, + | ^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA` + | + = help: the following other types implement trait `FromInputValue`: + > + > + > + > + as FromInputValue> + > + > + > + and $N others note: required by a bound in `Registry::<'r, S>::arg` - --> $WORKSPACE/juniper/src/executor/mod.rs - | - | pub fn arg(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S> - | --- required by a bound in this associated function - | where - | T: GraphQLType + FromInputValue, - | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` - = note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | pub fn arg(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S> + | --- required by a bound in this associated function + | where + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied --> fail/input-object/derive_incompatible_field_type.rs:8:10 diff --git a/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr b/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr index f2d975b29..cd32c75c9 100644 --- a/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr +++ b/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr @@ -1,16 +1,16 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/struct/attr_field_non_output_return_type.rs:10:9 - | -10 | id: ObjB, - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | - = help: the following other types implement trait `IsOutputType`: - > - > - > - > - as IsOutputType> - > - > - > - and $N others + --> fail/interface/struct/attr_field_non_output_return_type.rs:8:1 + | +8 | #[graphql_interface] + | ^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + > + > + > + > + as IsOutputType> + > + > + > + and $N others diff --git a/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr b/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr index 8bc3aa0b7..d8b5b7333 100644 --- a/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr +++ b/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr @@ -1,16 +1,16 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/struct/derive_field_non_output_return_type.rs:10:9 - | -10 | id: ObjB, - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | - = help: the following other types implement trait `IsOutputType`: - > - > - > - > - as IsOutputType> - > - > - > - and $N others + --> fail/interface/struct/derive_field_non_output_return_type.rs:8:10 + | +8 | #[derive(GraphQLInterface)] + | ^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + > + > + > + > + as IsOutputType> + > + > + > + and $N others diff --git a/tests/codegen/fail/interface/trait/argument_non_input_type.stderr b/tests/codegen/fail/interface/trait/argument_non_input_type.stderr index 0a1438368..a6af9595d 100644 --- a/tests/codegen/fail/interface/trait/argument_non_input_type.stderr +++ b/tests/codegen/fail/interface/trait/argument_non_input_type.stderr @@ -16,27 +16,29 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied and $N others error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied - --> fail/interface/trait/argument_non_input_type.rs:8:1 - | -8 | #[graphql_interface] - | ^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` - | - = help: the following other types implement trait `FromInputValue`: - > - > - > - as FromInputValue> - > - > - > - > - and $N others + --> fail/interface/trait/argument_non_input_type.rs:10:23 + | +8 | #[graphql_interface] + | -------------------- required by a bound introduced by this call +9 | trait Character { +10 | fn id(&self, obj: ObjA) -> &str; + | ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `FromInputValue`: + > + > + > + as FromInputValue> + > + > + > + > + and $N others note: required by a bound in `Registry::<'r, S>::arg` - --> $WORKSPACE/juniper/src/executor/mod.rs - | - | pub fn arg(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S> - | --- required by a bound in this associated function - | where - | T: GraphQLType + FromInputValue, - | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` - = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | pub fn arg(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S> + | --- required by a bound in this associated function + | where + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` diff --git a/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr b/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr index 5f7140865..ca0c5593d 100644 --- a/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr +++ b/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr @@ -1,16 +1,16 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/trait/field_non_output_return_type.rs:10:21 - | -10 | fn id(&self) -> ObjB; - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | - = help: the following other types implement trait `IsOutputType`: - > - > - > - > - as IsOutputType> - > - > - > - and $N others + --> fail/interface/trait/field_non_output_return_type.rs:8:1 + | +8 | #[graphql_interface] + | ^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + > + > + > + > + as IsOutputType> + > + > + > + and $N others diff --git a/tests/codegen/fail/object/argument_non_input_type.stderr b/tests/codegen/fail/object/argument_non_input_type.stderr index 5310ce4a3..323928ff3 100644 --- a/tests/codegen/fail/object/argument_non_input_type.stderr +++ b/tests/codegen/fail/object/argument_non_input_type.stderr @@ -16,10 +16,13 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied and $N others error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied - --> fail/object/argument_non_input_type.rs:10:1 + --> fail/object/argument_non_input_type.rs:12:23 | 10 | #[graphql_object] - | ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | ----------------- required by a bound introduced by this call +11 | impl ObjB { +12 | fn id(&self, obj: ObjA) -> &str { + | ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` | = help: the following other types implement trait `FromInputValue`: > @@ -39,7 +42,6 @@ note: required by a bound in `Registry::<'r, S>::arg` | where | T: GraphQLType + FromInputValue, | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` - = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/object/argument_non_input_type.rs:10:1 @@ -58,3 +60,20 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied > and $N others = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/object/argument_non_input_type.rs:12:23 + | +12 | fn id(&self, obj: ObjA) -> &str { + | ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `FromInputValue`: + > + > + > + as FromInputValue> + > + > + > + > + and $N others diff --git a/tests/codegen/fail/object/attr_field_non_output_return_type.stderr b/tests/codegen/fail/object/attr_field_non_output_return_type.stderr index d6fbf56de..1c775851b 100644 --- a/tests/codegen/fail/object/attr_field_non_output_return_type.stderr +++ b/tests/codegen/fail/object/attr_field_non_output_return_type.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/object/attr_field_non_output_return_type.rs:12:21 + --> fail/object/attr_field_non_output_return_type.rs:10:1 | -12 | fn id(&self) -> ObjB { - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` +10 | #[graphql_object] + | ^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` | = help: the following other types implement trait `IsOutputType`: > diff --git a/tests/codegen/fail/object/derive_field_non_output_return_type.stderr b/tests/codegen/fail/object/derive_field_non_output_return_type.stderr index 75dff2be2..ad431c534 100644 --- a/tests/codegen/fail/object/derive_field_non_output_return_type.stderr +++ b/tests/codegen/fail/object/derive_field_non_output_return_type.stderr @@ -1,16 +1,16 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/object/derive_field_non_output_return_type.rs:10:9 - | -10 | id: ObjB, - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` - | - = help: the following other types implement trait `IsOutputType`: - > - > - > - > - as IsOutputType> - > - > - > - and $N others + --> fail/object/derive_field_non_output_return_type.rs:8:10 + | +8 | #[derive(GraphQLObject)] + | ^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + > + > + > + > + as IsOutputType> + > + > + > + and $N others diff --git a/tests/codegen/fail/subscription/argument_non_input_type.stderr b/tests/codegen/fail/subscription/argument_non_input_type.stderr index 3e2b9aaaa..baded3fdd 100644 --- a/tests/codegen/fail/subscription/argument_non_input_type.stderr +++ b/tests/codegen/fail/subscription/argument_non_input_type.stderr @@ -24,10 +24,13 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied and $N others error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied - --> fail/subscription/argument_non_input_type.rs:15:1 + --> fail/subscription/argument_non_input_type.rs:17:29 | 15 | #[graphql_subscription] - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | ----------------------- required by a bound introduced by this call +16 | impl ObjB { +17 | async fn id(&self, obj: ObjA) -> Stream<'static, &'static str> { + | ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` | = help: the following other types implement trait `FromInputValue`: > @@ -47,7 +50,6 @@ note: required by a bound in `Registry::<'r, S>::arg` | where | T: GraphQLType + FromInputValue, | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` - = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/subscription/argument_non_input_type.rs:15:1 @@ -66,3 +68,20 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied > and $N others = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/subscription/argument_non_input_type.rs:17:29 + | +17 | async fn id(&self, obj: ObjA) -> Stream<'static, &'static str> { + | ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `FromInputValue`: + > + > + > + as FromInputValue> + > + > + > + > + and $N others diff --git a/tests/codegen/fail/subscription/field_non_output_return_type.stderr b/tests/codegen/fail/subscription/field_non_output_return_type.stderr index e1a425513..5a47e2c7f 100644 --- a/tests/codegen/fail/subscription/field_non_output_return_type.stderr +++ b/tests/codegen/fail/subscription/field_non_output_return_type.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/subscription/field_non_output_return_type.rs:17:27 + --> fail/subscription/field_non_output_return_type.rs:15:1 | -17 | async fn id(&self) -> Stream<'static, ObjB> { - | ^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` +15 | #[graphql_subscription] + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` | = help: the following other types implement trait `IsOutputType`: > diff --git a/tests/codegen/fail/union/enum_non_object_variant.stderr b/tests/codegen/fail/union/enum_non_object_variant.stderr index 3e75bb5a0..c0356aa36 100644 --- a/tests/codegen/fail/union/enum_non_object_variant.stderr +++ b/tests/codegen/fail/union/enum_non_object_variant.stderr @@ -1,17 +1,16 @@ error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/enum_non_object_variant.rs:9:10 - | -9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | - = help: the following other types implement trait `GraphQLObject`: - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - > - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - <&T as GraphQLObject> - = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/enum_non_object_variant.rs:11:10 + | +11 | Test(Test), + | ^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = help: the following other types implement trait `GraphQLObject`: + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + > + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + <&T as GraphQLObject> diff --git a/tests/codegen/fail/union/struct_non_object_variant.stderr b/tests/codegen/fail/union/struct_non_object_variant.stderr index ebbb6a18d..934344c60 100644 --- a/tests/codegen/fail/union/struct_non_object_variant.stderr +++ b/tests/codegen/fail/union/struct_non_object_variant.stderr @@ -1,17 +1,16 @@ error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/struct_non_object_variant.rs:9:10 - | -9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | - = help: the following other types implement trait `GraphQLObject`: - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - > - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - <&T as GraphQLObject> - = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/struct_non_object_variant.rs:10:14 + | +10 | #[graphql(on Test = Character::a)] + | ^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = help: the following other types implement trait `GraphQLObject`: + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + > + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + <&T as GraphQLObject> diff --git a/tests/codegen/fail/union/trait_non_object_variant.stderr b/tests/codegen/fail/union/trait_non_object_variant.stderr index 6ff1aeb90..602147594 100644 --- a/tests/codegen/fail/union/trait_non_object_variant.stderr +++ b/tests/codegen/fail/union/trait_non_object_variant.stderr @@ -1,17 +1,16 @@ error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/trait_non_object_variant.rs:9:1 - | -9 | #[graphql_union] - | ^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | - = help: the following other types implement trait `GraphQLObject`: - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - > - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - as GraphQLObject> - <&T as GraphQLObject> - = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) + --> fail/union/trait_non_object_variant.rs:11:28 + | +11 | fn a(&self) -> Option<&Test>; + | ^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = help: the following other types implement trait `GraphQLObject`: + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + > + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + <&T as GraphQLObject>