Skip to content

Commit 0a550a1

Browse files
committed
Update codegen tests for 1.94 Rust
1 parent cef5b9b commit 0a550a1

13 files changed

Lines changed: 327 additions & 31 deletions

juniper_axum/src/extract.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use axum::{
77
body::Body,
88
extract::{FromRequest, FromRequestParts, Query},
99
http::{HeaderValue, Method, Request, StatusCode, header},
10-
response::{IntoResponse as _, Response},
10+
response::{IntoResponse, Response},
1111
};
1212
use juniper::{
1313
DefaultScalarValue, ScalarValue,
@@ -103,7 +103,6 @@ where
103103
StatusCode::BAD_REQUEST,
104104
format!("Invalid request query string: {e}"),
105105
)
106-
.into_response()
107106
})
108107
.and_then(|query| {
109108
query
@@ -115,9 +114,9 @@ where
115114
StatusCode::BAD_REQUEST,
116115
format!("Invalid request query `variables`: {e}"),
117116
)
118-
.into_response()
119117
})
120-
}),
118+
})
119+
.map_err(IntoResponse::into_response),
121120
(&Method::POST, Some(x)) if x.starts_with("application/json") => {
122121
Json::<GraphQLBatchRequest<S>>::from_request(req, state)
123122
.await

tests/codegen/fail/input_object/enum/derive_incompatible_field_type.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ help: the trait `IsInputType<__S>` is not implemented for `ObjectA`
1616
`Box<T>` implements `IsInputType<S>`
1717
`ID` implements `IsInputType<__S>`
1818
`Object` implements `IsInputType<__S>`
19-
`TypeKind` implements `IsInputType<__S>`
2019
`Vec<T>` implements `IsInputType<S>`
20+
`[T; N]` implements `IsInputType<S>`
2121
and $N others
2222
= note: required for `std::option::Option<ObjectA>` to implement `IsInputType<__S>`
2323
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -39,9 +39,9 @@ help: the trait `FromInputValue<__S>` is not implemented for `ObjectA`
3939
`Box<T>` implements `FromInputValue<S>`
4040
`ID` implements `FromInputValue<__S>`
4141
`Object` implements `FromInputValue<__S>`
42-
`TypeKind` implements `FromInputValue<__S>`
4342
`Vec<T>` implements `FromInputValue<S>`
4443
`[T; N]` implements `FromInputValue<S>`
44+
`bool` implements `FromInputValue<__S>`
4545
and $N others
4646
= note: required for `std::option::Option<ObjectA>` to implement `FromInputValue<__S>`
4747
note: required by a bound in `Registry::<S>::arg`
@@ -71,9 +71,9 @@ help: the trait `FromInputValue<__S>` is not implemented for `ObjectA`
7171
`Box<T>` implements `FromInputValue<S>`
7272
`ID` implements `FromInputValue<__S>`
7373
`Object` implements `FromInputValue<__S>`
74-
`TypeKind` implements `FromInputValue<__S>`
7574
`Vec<T>` implements `FromInputValue<S>`
7675
`[T; N]` implements `FromInputValue<S>`
76+
`bool` implements `FromInputValue<__S>`
7777
and $N others
7878
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
7979

@@ -95,8 +95,8 @@ help: the trait `ToInputValue<_>` is not implemented for `ObjectA`
9595
`Box<T>` implements `ToInputValue<S>`
9696
`ID` implements `ToInputValue<__S>`
9797
`Object` implements `ToInputValue<__S>`
98-
`TypeKind` implements `ToInputValue<__S>`
9998
`Value<S>` implements `ToInputValue<S>`
99+
`Vec<T>` implements `ToInputValue<S>`
100100
and $N others
101101
= note: required for `&ObjectA` to implement `ToInputValue<_>`
102102
= note: 1 redundant requirement hidden

tests/codegen/fail/input_object/struct/derive_incompatible_field_type.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ help: the trait `IsInputType<__S>` is not implemented for `ObjectA`
1616
`Box<T>` implements `IsInputType<S>`
1717
`ID` implements `IsInputType<__S>`
1818
`Object` implements `IsInputType<__S>`
19-
`TypeKind` implements `IsInputType<__S>`
2019
`Vec<T>` implements `IsInputType<S>`
20+
`[T; N]` implements `IsInputType<S>`
2121
and $N others
2222

2323
error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
@@ -40,9 +40,9 @@ help: the trait `FromInputValue<__S>` is not implemented for `ObjectA`
4040
`Box<T>` implements `FromInputValue<S>`
4141
`ID` implements `FromInputValue<__S>`
4242
`Object` implements `FromInputValue<__S>`
43-
`TypeKind` implements `FromInputValue<__S>`
4443
`Vec<T>` implements `FromInputValue<S>`
4544
`[T; N]` implements `FromInputValue<S>`
45+
`bool` implements `FromInputValue<__S>`
4646
and $N others
4747
note: required by a bound in `Registry::<S>::arg`
4848
--> $WORKSPACE/juniper/src/executor/mod.rs
@@ -70,9 +70,9 @@ help: the trait `FromInputValue<__S>` is not implemented for `ObjectA`
7070
`Box<T>` implements `FromInputValue<S>`
7171
`ID` implements `FromInputValue<__S>`
7272
`Object` implements `FromInputValue<__S>`
73-
`TypeKind` implements `FromInputValue<__S>`
7473
`Vec<T>` implements `FromInputValue<S>`
7574
`[T; N]` implements `FromInputValue<S>`
75+
`bool` implements `FromInputValue<__S>`
7676
and $N others
7777
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
7878

@@ -94,7 +94,7 @@ help: the trait `ToInputValue<_>` is not implemented for `ObjectA`
9494
`Box<T>` implements `ToInputValue<S>`
9595
`ID` implements `ToInputValue<__S>`
9696
`Object` implements `ToInputValue<__S>`
97-
`TypeKind` implements `ToInputValue<__S>`
9897
`Value<S>` implements `ToInputValue<S>`
98+
`Vec<T>` implements `ToInputValue<S>`
9999
and $N others
100100
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/codegen/fail/interface/struct/attr_cyclic_impl.stderr

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,75 @@ note: cycle used when computing type of `<impl at $DIR/fail/interface/struct/att
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2121
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
2222
= note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info)
23+
24+
error[E0658]: use of unstable library feature `str_as_str`
25+
--> fail/interface/struct/attr_cyclic_impl.rs:5:5
26+
|
27+
5 | id: String,
28+
| ^^
29+
|
30+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
31+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
32+
33+
error[E0658]: use of unstable library feature `str_as_str`
34+
--> fail/interface/struct/attr_cyclic_impl.rs:5:5
35+
|
36+
5 | id: String,
37+
| ^^
38+
|
39+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
40+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
41+
42+
error[E0658]: use of unstable library feature `str_as_str`
43+
--> fail/interface/struct/attr_cyclic_impl.rs:5:5
44+
|
45+
5 | id: String,
46+
| ^^
47+
|
48+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
49+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
50+
51+
error[E0658]: use of unstable library feature `str_as_str`
52+
--> fail/interface/struct/attr_cyclic_impl.rs:5:5
53+
|
54+
5 | id: String,
55+
| ^^
56+
|
57+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
58+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
59+
60+
error[E0658]: use of unstable library feature `str_as_str`
61+
--> fail/interface/struct/attr_cyclic_impl.rs:10:5
62+
|
63+
10 | id: String,
64+
| ^^
65+
|
66+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
67+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
68+
69+
error[E0658]: use of unstable library feature `str_as_str`
70+
--> fail/interface/struct/attr_cyclic_impl.rs:10:5
71+
|
72+
10 | id: String,
73+
| ^^
74+
|
75+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
76+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
77+
78+
error[E0658]: use of unstable library feature `str_as_str`
79+
--> fail/interface/struct/attr_cyclic_impl.rs:10:5
80+
|
81+
10 | id: String,
82+
| ^^
83+
|
84+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
85+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
86+
87+
error[E0658]: use of unstable library feature `str_as_str`
88+
--> fail/interface/struct/attr_cyclic_impl.rs:10:5
89+
|
90+
10 | id: String,
91+
| ^^
92+
|
93+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
94+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/codegen/fail/interface/struct/attr_missing_field.stderr

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ error[E0080]: evaluation panicked: failed to implement interface `Character` on
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
88

9+
error[E0658]: use of unstable library feature `str_as_str`
10+
--> fail/interface/struct/attr_missing_field.rs:11:5
11+
|
12+
11 | id: String,
13+
| ^^
14+
|
15+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
16+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
17+
18+
error[E0658]: use of unstable library feature `str_as_str`
19+
--> fail/interface/struct/attr_missing_field.rs:11:5
20+
|
21+
11 | id: String,
22+
| ^^
23+
|
24+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
25+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
26+
927
error[E0277]: the trait bound `ObjA: FieldMeta<DefaultScalarValue, 11301463986558097276003903130001171064>` is not satisfied
1028
--> fail/interface/struct/attr_missing_field.rs:9:27
1129
|
@@ -20,6 +38,15 @@ help: the trait `FieldMeta<DefaultScalarValue, 113014639865580972760039031300011
2038
| ^^^^^^^^^^^^^
2139
= note: this error originates in the derive macro `GraphQLObject` (in Nightly builds, run with -Z macro-backtrace for more info)
2240

41+
error[E0658]: use of unstable library feature `str_as_str`
42+
--> fail/interface/struct/attr_missing_field.rs:11:5
43+
|
44+
11 | id: String,
45+
| ^^
46+
|
47+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
48+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
49+
2350
error[E0080]: evaluation panicked: failed to implement interface `Character` on `ObjA`: field `id` isn't implemented on `ObjA`
2451
--> fail/interface/struct/attr_missing_field.rs:11:5
2552
|

tests/codegen/fail/interface/struct/derive_cyclic_impl.stderr

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,75 @@ note: cycle used when computing type of `<impl at $DIR/fail/interface/struct/der
2020
| ^^^^^^^^^^^^^^^^
2121
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
2222
= note: this error originates in the derive macro `GraphQLInterface` (in Nightly builds, run with -Z macro-backtrace for more info)
23+
24+
error[E0658]: use of unstable library feature `str_as_str`
25+
--> fail/interface/struct/derive_cyclic_impl.rs:6:5
26+
|
27+
6 | id: String,
28+
| ^^
29+
|
30+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
31+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
32+
33+
error[E0658]: use of unstable library feature `str_as_str`
34+
--> fail/interface/struct/derive_cyclic_impl.rs:6:5
35+
|
36+
6 | id: String,
37+
| ^^
38+
|
39+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
40+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
41+
42+
error[E0658]: use of unstable library feature `str_as_str`
43+
--> fail/interface/struct/derive_cyclic_impl.rs:6:5
44+
|
45+
6 | id: String,
46+
| ^^
47+
|
48+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
49+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
50+
51+
error[E0658]: use of unstable library feature `str_as_str`
52+
--> fail/interface/struct/derive_cyclic_impl.rs:6:5
53+
|
54+
6 | id: String,
55+
| ^^
56+
|
57+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
58+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
59+
60+
error[E0658]: use of unstable library feature `str_as_str`
61+
--> fail/interface/struct/derive_cyclic_impl.rs:12:5
62+
|
63+
12 | id: String,
64+
| ^^
65+
|
66+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
67+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
68+
69+
error[E0658]: use of unstable library feature `str_as_str`
70+
--> fail/interface/struct/derive_cyclic_impl.rs:12:5
71+
|
72+
12 | id: String,
73+
| ^^
74+
|
75+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
76+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
77+
78+
error[E0658]: use of unstable library feature `str_as_str`
79+
--> fail/interface/struct/derive_cyclic_impl.rs:12:5
80+
|
81+
12 | id: String,
82+
| ^^
83+
|
84+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
85+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
86+
87+
error[E0658]: use of unstable library feature `str_as_str`
88+
--> fail/interface/struct/derive_cyclic_impl.rs:12:5
89+
|
90+
12 | id: String,
91+
| ^^
92+
|
93+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
94+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/codegen/fail/interface/struct/derive_missing_field.stderr

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ error[E0080]: evaluation panicked: failed to implement interface `Character` on
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
88

9+
error[E0658]: use of unstable library feature `str_as_str`
10+
--> fail/interface/struct/derive_missing_field.rs:12:5
11+
|
12+
12 | id: String,
13+
| ^^
14+
|
15+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
16+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
17+
18+
error[E0658]: use of unstable library feature `str_as_str`
19+
--> fail/interface/struct/derive_missing_field.rs:12:5
20+
|
21+
12 | id: String,
22+
| ^^
23+
|
24+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
25+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
26+
927
error[E0277]: the trait bound `ObjA: FieldMeta<DefaultScalarValue, 11301463986558097276003903130001171064>` is not satisfied
1028
--> fail/interface/struct/derive_missing_field.rs:10:17
1129
|
@@ -20,6 +38,15 @@ help: the trait `FieldMeta<DefaultScalarValue, 113014639865580972760039031300011
2038
| ^^^^^^^^^^^^^
2139
= note: this error originates in the derive macro `GraphQLObject` (in Nightly builds, run with -Z macro-backtrace for more info)
2240

41+
error[E0658]: use of unstable library feature `str_as_str`
42+
--> fail/interface/struct/derive_missing_field.rs:12:5
43+
|
44+
12 | id: String,
45+
| ^^
46+
|
47+
= note: see issue #130366 <https://github.com/rust-lang/rust/issues/130366> for more information
48+
= note: this error originates in the macro `$crate::format_type` which comes from the expansion of the macro `::juniper::assert_field` (in Nightly builds, run with -Z macro-backtrace for more info)
49+
2350
error[E0080]: evaluation panicked: failed to implement interface `Character` on `ObjA`: field `id` isn't implemented on `ObjA`
2451
--> fail/interface/struct/derive_missing_field.rs:12:5
2552
|

tests/codegen/fail/interface/trait/argument_non_input_type.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ help: the trait `IsInputType<__S>` is not implemented for `ObjA`
1515
`ArcStr` implements `IsInputType<__S>`
1616
`Box<T>` implements `IsInputType<S>`
1717
`ID` implements `IsInputType<__S>`
18-
`TypeKind` implements `IsInputType<__S>`
1918
`Vec<T>` implements `IsInputType<S>`
2019
`[T; N]` implements `IsInputType<S>`
20+
`[T]` implements `IsInputType<S>`
2121
and $N others
2222

2323
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
@@ -39,10 +39,10 @@ help: the trait `FromInputValue<__S>` is not implemented for `ObjA`
3939
`ArcStr` implements `FromInputValue<__S>`
4040
`Box<T>` implements `FromInputValue<S>`
4141
`ID` implements `FromInputValue<__S>`
42-
`TypeKind` implements `FromInputValue<__S>`
4342
`Vec<T>` implements `FromInputValue<S>`
4443
`[T; N]` implements `FromInputValue<S>`
4544
`bool` implements `FromInputValue<__S>`
45+
`compact_str::CompactString` implements `FromInputValue<__S>`
4646
and $N others
4747
note: required by a bound in `Registry::<S>::arg`
4848
--> $WORKSPACE/juniper/src/executor/mod.rs

0 commit comments

Comments
 (0)