Skip to content

Commit 20c76a6

Browse files
committed
Fix codegen tests for latest nightly
1 parent b375146 commit 20c76a6

File tree

7 files changed

+175
-137
lines changed

7 files changed

+175
-137
lines changed

tests/codegen/fail/input-object/derive_incompatible_field_type.stderr

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
11
error[E0277]: the trait bound `ObjectA: IsInputType<__S>` is not satisfied
2-
--> fail/input-object/derive_incompatible_field_type.rs:8:10
3-
|
4-
8 | #[derive(GraphQLInputObject)]
5-
| ^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA`
6-
|
7-
= help: the following other types implement trait `IsInputType<S>`:
8-
<bool as IsInputType<__S>>
9-
<i32 as IsInputType<__S>>
10-
<f64 as IsInputType<__S>>
11-
<Object as IsInputType<__S>>
12-
<Box<T> as IsInputType<S>>
13-
<uuid::Uuid as IsInputType<__S>>
14-
<url::Url as IsInputType<__S>>
15-
<bson::datetime::DateTime as IsInputType<__S>>
16-
and $N others
17-
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
2+
--> fail/input-object/derive_incompatible_field_type.rs:10:12
3+
|
4+
10 | field: ObjectA,
5+
| ^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA`
6+
|
7+
= help: the following other types implement trait `IsInputType<S>`:
8+
<bool as IsInputType<__S>>
9+
<i32 as IsInputType<__S>>
10+
<f64 as IsInputType<__S>>
11+
<Object as IsInputType<__S>>
12+
<Box<T> as IsInputType<S>>
13+
<uuid::Uuid as IsInputType<__S>>
14+
<url::Url as IsInputType<__S>>
15+
<bson::datetime::DateTime as IsInputType<__S>>
16+
and $N others
1817

1918
error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
20-
--> fail/input-object/derive_incompatible_field_type.rs:8:10
21-
|
22-
8 | #[derive(GraphQLInputObject)]
23-
| ^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA`
24-
|
25-
= help: the following other types implement trait `FromInputValue<S>`:
26-
<bool as FromInputValue<__S>>
27-
<i32 as FromInputValue<__S>>
28-
<f64 as FromInputValue<__S>>
29-
<Object as FromInputValue<__S>>
30-
<Box<T> as FromInputValue<S>>
31-
<uuid::Uuid as FromInputValue<__S>>
32-
<url::Url as FromInputValue<__S>>
33-
<bson::datetime::DateTime as FromInputValue<__S>>
34-
and $N others
19+
--> fail/input-object/derive_incompatible_field_type.rs:10:12
20+
|
21+
8 | #[derive(GraphQLInputObject)]
22+
| ------------------ required by a bound introduced by this call
23+
9 | struct Object {
24+
10 | field: ObjectA,
25+
| ^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA`
26+
|
27+
= help: the following other types implement trait `FromInputValue<S>`:
28+
<bool as FromInputValue<__S>>
29+
<i32 as FromInputValue<__S>>
30+
<f64 as FromInputValue<__S>>
31+
<Object as FromInputValue<__S>>
32+
<Box<T> as FromInputValue<S>>
33+
<uuid::Uuid as FromInputValue<__S>>
34+
<url::Url as FromInputValue<__S>>
35+
<bson::datetime::DateTime as FromInputValue<__S>>
36+
and $N others
3537
note: required by a bound in `Registry::<'r, S>::arg`
36-
--> $WORKSPACE/juniper/src/executor/mod.rs
37-
|
38-
| pub fn arg<T>(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S>
39-
| --- required by a bound in this associated function
40-
| where
41-
| T: GraphQLType<S> + FromInputValue<S>,
42-
| ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg`
43-
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
38+
--> $WORKSPACE/juniper/src/executor/mod.rs
39+
|
40+
| pub fn arg<T>(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S>
41+
| --- required by a bound in this associated function
42+
| where
43+
| T: GraphQLType<S> + FromInputValue<S>,
44+
| ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg`
4445

4546
error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
4647
--> fail/input-object/derive_incompatible_field_type.rs:8:10
Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
2-
--> fail/interface/trait/argument_non_input_type.rs:8:1
3-
|
4-
8 | #[graphql_interface]
5-
| ^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA`
6-
|
7-
= help: the following other types implement trait `IsInputType<S>`:
8-
<bool as IsInputType<__S>>
9-
<i32 as IsInputType<__S>>
10-
<f64 as IsInputType<__S>>
11-
<Box<T> as IsInputType<S>>
12-
<uuid::Uuid as IsInputType<__S>>
13-
<url::Url as IsInputType<__S>>
14-
<bson::datetime::DateTime as IsInputType<__S>>
15-
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
16-
and $N others
2+
--> fail/interface/trait/argument_non_input_type.rs:10:23
3+
|
4+
10 | fn id(&self, obj: ObjA) -> &str;
5+
| ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA`
6+
|
7+
= help: the following other types implement trait `IsInputType<S>`:
8+
<bool as IsInputType<__S>>
9+
<i32 as IsInputType<__S>>
10+
<f64 as IsInputType<__S>>
11+
<Box<T> as IsInputType<S>>
12+
<uuid::Uuid as IsInputType<__S>>
13+
<url::Url as IsInputType<__S>>
14+
<bson::datetime::DateTime as IsInputType<__S>>
15+
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
16+
and $N others
1717

1818
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
19-
--> fail/interface/trait/argument_non_input_type.rs:8:1
20-
|
21-
8 | #[graphql_interface]
22-
| ^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
23-
|
24-
= help: the following other types implement trait `FromInputValue<S>`:
25-
<bool as FromInputValue<__S>>
26-
<i32 as FromInputValue<__S>>
27-
<f64 as FromInputValue<__S>>
28-
<Box<T> as FromInputValue<S>>
29-
<uuid::Uuid as FromInputValue<__S>>
30-
<url::Url as FromInputValue<__S>>
31-
<bson::datetime::DateTime as FromInputValue<__S>>
32-
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
33-
and $N others
19+
--> fail/interface/trait/argument_non_input_type.rs:10:23
20+
|
21+
8 | #[graphql_interface]
22+
| -------------------- required by a bound introduced by this call
23+
9 | trait Character {
24+
10 | fn id(&self, obj: ObjA) -> &str;
25+
| ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
26+
|
27+
= help: the following other types implement trait `FromInputValue<S>`:
28+
<bool as FromInputValue<__S>>
29+
<i32 as FromInputValue<__S>>
30+
<f64 as FromInputValue<__S>>
31+
<Box<T> as FromInputValue<S>>
32+
<uuid::Uuid as FromInputValue<__S>>
33+
<url::Url as FromInputValue<__S>>
34+
<bson::datetime::DateTime as FromInputValue<__S>>
35+
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
36+
and $N others
3437
note: required by a bound in `Registry::<'r, S>::arg`
35-
--> $WORKSPACE/juniper/src/executor/mod.rs
36-
|
37-
| pub fn arg<T>(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S>
38-
| --- required by a bound in this associated function
39-
| where
40-
| T: GraphQLType<S> + FromInputValue<S>,
41-
| ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg`
42-
= note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info)
38+
--> $WORKSPACE/juniper/src/executor/mod.rs
39+
|
40+
| pub fn arg<T>(&mut self, name: &str, info: &T::TypeInfo) -> Argument<'r, S>
41+
| --- required by a bound in this associated function
42+
| where
43+
| T: GraphQLType<S> + FromInputValue<S>,
44+
| ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg`

tests/codegen/fail/object/argument_non_input_type.stderr

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
2-
--> fail/object/argument_non_input_type.rs:10:1
2+
--> fail/object/argument_non_input_type.rs:12:23
33
|
4-
10 | #[graphql_object]
5-
| ^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA`
4+
12 | fn id(&self, obj: ObjA) -> &str {
5+
| ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA`
66
|
77
= help: the following other types implement trait `IsInputType<S>`:
88
<bool as IsInputType<__S>>
@@ -16,10 +16,13 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
1616
and $N others
1717

1818
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
19-
--> fail/object/argument_non_input_type.rs:10:1
19+
--> fail/object/argument_non_input_type.rs:12:23
2020
|
2121
10 | #[graphql_object]
22-
| ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
22+
| ----------------- required by a bound introduced by this call
23+
11 | impl ObjB {
24+
12 | fn id(&self, obj: ObjA) -> &str {
25+
| ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
2326
|
2427
= help: the following other types implement trait `FromInputValue<S>`:
2528
<bool as FromInputValue<__S>>
@@ -39,7 +42,6 @@ note: required by a bound in `Registry::<'r, S>::arg`
3942
| where
4043
| T: GraphQLType<S> + FromInputValue<S>,
4144
| ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg`
42-
= note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info)
4345

4446
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
4547
--> fail/object/argument_non_input_type.rs:10:1
@@ -58,3 +60,20 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
5860
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
5961
and $N others
6062
= note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info)
63+
64+
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
65+
--> fail/object/argument_non_input_type.rs:12:23
66+
|
67+
12 | fn id(&self, obj: ObjA) -> &str {
68+
| ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
69+
|
70+
= help: the following other types implement trait `FromInputValue<S>`:
71+
<bool as FromInputValue<__S>>
72+
<i32 as FromInputValue<__S>>
73+
<f64 as FromInputValue<__S>>
74+
<Box<T> as FromInputValue<S>>
75+
<uuid::Uuid as FromInputValue<__S>>
76+
<url::Url as FromInputValue<__S>>
77+
<bson::datetime::DateTime as FromInputValue<__S>>
78+
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
79+
and $N others

tests/codegen/fail/subscription/argument_non_input_type.stderr

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ warning: unused variable: `obj`
77
= note: `#[warn(unused_variables)]` on by default
88

99
error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
10-
--> fail/subscription/argument_non_input_type.rs:15:1
10+
--> fail/subscription/argument_non_input_type.rs:17:29
1111
|
12-
15 | #[graphql_subscription]
13-
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA`
12+
17 | async fn id(&self, obj: ObjA) -> Stream<'static, &'static str> {
13+
| ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA`
1414
|
1515
= help: the following other types implement trait `IsInputType<S>`:
1616
<bool as IsInputType<__S>>
@@ -24,10 +24,13 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
2424
and $N others
2525

2626
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
27-
--> fail/subscription/argument_non_input_type.rs:15:1
27+
--> fail/subscription/argument_non_input_type.rs:17:29
2828
|
2929
15 | #[graphql_subscription]
30-
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
30+
| ----------------------- required by a bound introduced by this call
31+
16 | impl ObjB {
32+
17 | async fn id(&self, obj: ObjA) -> Stream<'static, &'static str> {
33+
| ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
3134
|
3235
= help: the following other types implement trait `FromInputValue<S>`:
3336
<bool as FromInputValue<__S>>
@@ -47,7 +50,6 @@ note: required by a bound in `Registry::<'r, S>::arg`
4750
| where
4851
| T: GraphQLType<S> + FromInputValue<S>,
4952
| ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg`
50-
= note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info)
5153

5254
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
5355
--> fail/subscription/argument_non_input_type.rs:15:1
@@ -66,3 +68,20 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
6668
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
6769
and $N others
6870
= note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info)
71+
72+
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
73+
--> fail/subscription/argument_non_input_type.rs:17:29
74+
|
75+
17 | async fn id(&self, obj: ObjA) -> Stream<'static, &'static str> {
76+
| ^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA`
77+
|
78+
= help: the following other types implement trait `FromInputValue<S>`:
79+
<bool as FromInputValue<__S>>
80+
<i32 as FromInputValue<__S>>
81+
<f64 as FromInputValue<__S>>
82+
<Box<T> as FromInputValue<S>>
83+
<uuid::Uuid as FromInputValue<__S>>
84+
<url::Url as FromInputValue<__S>>
85+
<bson::datetime::DateTime as FromInputValue<__S>>
86+
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
87+
and $N others
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied
2-
--> fail/union/enum_non_object_variant.rs:9:10
3-
|
4-
9 | #[derive(GraphQLUnion)]
5-
| ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test`
6-
|
7-
= help: the following other types implement trait `GraphQLObject<S>`:
8-
<Box<T> as GraphQLObject<S>>
9-
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
10-
<Argument<'a, S> as GraphQLObject<S>>
11-
<EnumValue as GraphQLObject<__S>>
12-
<SchemaType<'a, S> as GraphQLObject<S>>
13-
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
14-
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
15-
<Arc<T> as GraphQLObject<S>>
16-
<&T as GraphQLObject<S>>
17-
= note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info)
2+
--> fail/union/enum_non_object_variant.rs:11:10
3+
|
4+
11 | Test(Test),
5+
| ^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test`
6+
|
7+
= help: the following other types implement trait `GraphQLObject<S>`:
8+
<Box<T> as GraphQLObject<S>>
9+
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
10+
<Argument<'a, S> as GraphQLObject<S>>
11+
<EnumValue as GraphQLObject<__S>>
12+
<SchemaType<'a, S> as GraphQLObject<S>>
13+
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
14+
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
15+
<Arc<T> as GraphQLObject<S>>
16+
<&T as GraphQLObject<S>>
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied
2-
--> fail/union/struct_non_object_variant.rs:9:10
3-
|
4-
9 | #[derive(GraphQLUnion)]
5-
| ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test`
6-
|
7-
= help: the following other types implement trait `GraphQLObject<S>`:
8-
<Box<T> as GraphQLObject<S>>
9-
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
10-
<Argument<'a, S> as GraphQLObject<S>>
11-
<EnumValue as GraphQLObject<__S>>
12-
<SchemaType<'a, S> as GraphQLObject<S>>
13-
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
14-
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
15-
<Arc<T> as GraphQLObject<S>>
16-
<&T as GraphQLObject<S>>
17-
= note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info)
2+
--> fail/union/struct_non_object_variant.rs:10:14
3+
|
4+
10 | #[graphql(on Test = Character::a)]
5+
| ^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test`
6+
|
7+
= help: the following other types implement trait `GraphQLObject<S>`:
8+
<Box<T> as GraphQLObject<S>>
9+
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
10+
<Argument<'a, S> as GraphQLObject<S>>
11+
<EnumValue as GraphQLObject<__S>>
12+
<SchemaType<'a, S> as GraphQLObject<S>>
13+
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
14+
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
15+
<Arc<T> as GraphQLObject<S>>
16+
<&T as GraphQLObject<S>>
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied
2-
--> fail/union/trait_non_object_variant.rs:9:1
3-
|
4-
9 | #[graphql_union]
5-
| ^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test`
6-
|
7-
= help: the following other types implement trait `GraphQLObject<S>`:
8-
<Box<T> as GraphQLObject<S>>
9-
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
10-
<Argument<'a, S> as GraphQLObject<S>>
11-
<EnumValue as GraphQLObject<__S>>
12-
<SchemaType<'a, S> as GraphQLObject<S>>
13-
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
14-
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
15-
<Arc<T> as GraphQLObject<S>>
16-
<&T as GraphQLObject<S>>
17-
= note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info)
2+
--> fail/union/trait_non_object_variant.rs:11:28
3+
|
4+
11 | fn a(&self) -> Option<&Test>;
5+
| ^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test`
6+
|
7+
= help: the following other types implement trait `GraphQLObject<S>`:
8+
<Box<T> as GraphQLObject<S>>
9+
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
10+
<Argument<'a, S> as GraphQLObject<S>>
11+
<EnumValue as GraphQLObject<__S>>
12+
<SchemaType<'a, S> as GraphQLObject<S>>
13+
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
14+
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
15+
<Arc<T> as GraphQLObject<S>>
16+
<&T as GraphQLObject<S>>

0 commit comments

Comments
 (0)