Skip to content

Commit 226a27e

Browse files
committed
Fix nightly tests?
1 parent b8f499e commit 226a27e

11 files changed

+106
-89
lines changed

axum-macros/tests/debug_handler/fail/argument_not_extractor.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied
1515
<Version as FromRequestParts<S>>
1616
<Extensions as FromRequestParts<S>>
1717
<ConnectInfo<T> as FromRequestParts<S>>
18-
and $N others
18+
and 28 others
1919
= note: required for `bool` to implement `FromRequest<(), axum_core::extract::private::ViaParts>`
2020
note: required by a bound in `__axum_macros_check_handler_0_from_request_check`
2121
--> tests/debug_handler/fail/argument_not_extractor.rs:5:24

axum-macros/tests/debug_handler/fail/json_not_deserialize.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is
1313
i32
1414
i64
1515
i128
16-
and $N others
16+
and 131 others
1717
= note: required for `Struct` to implement `serde::de::DeserializeOwned`
1818
= note: required for `Json<Struct>` to implement `FromRequest<()>`
1919
= help: see issue #48214

axum-macros/tests/debug_handler/fail/single_wrong_return_tuple.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ error[E0277]: the trait bound `NotIntoResponse: IntoResponse` is not satisfied
1010
axum::body::Bytes
1111
Body
1212
axum::extract::rejection::FailedToBufferBody
13+
bytes::bytes_mut::BytesMut
1314
axum::extract::rejection::LengthLimitError
1415
axum::extract::rejection::UnknownBodyError
15-
bytes::bytes_mut::BytesMut
16-
and $N others
16+
and 121 others
1717
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
1818
--> tests/debug_handler/fail/single_wrong_return_tuple.rs:6:23
1919
|

axum-macros/tests/debug_handler/fail/wrong_return_tuple.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ error[E0277]: the trait bound `CustomIntoResponse: IntoResponseParts` is not sat
1919
[(K, V); N]
2020
()
2121
(T1,)
22-
and $N others
22+
and 15 others
2323
= help: see issue #48214
2424
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

axum-macros/tests/debug_handler/fail/wrong_return_type.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
1010
axum::body::Bytes
1111
Body
1212
axum::extract::rejection::FailedToBufferBody
13+
bytes::bytes_mut::BytesMut
1314
axum::extract::rejection::LengthLimitError
1415
axum::extract::rejection::UnknownBodyError
15-
bytes::bytes_mut::BytesMut
16-
and $N others
16+
and 121 others
1717
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
1818
--> tests/debug_handler/fail/wrong_return_type.rs:4:23
1919
|

axum-macros/tests/from_request/fail/generic_without_via.stderr

+19-19
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ error: #[derive(FromRequest)] only supports generics when used with #[from_reque
55
| ^
66

77
error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future<Output = ()> {foo}: Handler<_, _>` is not satisfied
8-
--> tests/from_request/fail/generic_without_via.rs:11:44
9-
|
10-
11 | _ = Router::<()>::new().route("/", get(foo));
11-
| --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}`
12-
| |
13-
| required by a bound introduced by this call
14-
|
15-
= note: Consider using `#[axum::debug_handler]` to improve the error message
16-
= help: the following other types implement trait `Handler<T, S>`:
17-
<Layered<L, H, T, S> as Handler<T, S>>
18-
<MethodRouter<S> as Handler<(), S>>
8+
--> tests/from_request/fail/generic_without_via.rs:11:44
9+
|
10+
11 | _ = Router::<()>::new().route("/", get(foo));
11+
| --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}`
12+
| |
13+
| required by a bound introduced by this call
14+
|
15+
= note: Consider using `#[axum::debug_handler]` to improve the error message
16+
= help: the following other types implement trait `Handler<T, S>`:
17+
<Layered<L, H, T, S> as Handler<T, S>>
18+
<MethodRouter<S> as Handler<(), S>>
1919
note: required by a bound in `axum::routing::get`
20-
--> $WORKSPACE/axum/src/routing/method_routing.rs
21-
|
22-
| top_level_handler_fn!(get, GET);
23-
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
24-
| | |
25-
| | required by a bound in this function
26-
| required by this bound in `get`
27-
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
20+
--> $WORKSPACE/axum/src/routing/method_routing.rs
21+
|
22+
| top_level_handler_fn!(get, GET);
23+
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
24+
| | |
25+
| | required by a bound in this function
26+
| required by this bound in `get`
27+
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

axum-macros/tests/from_request/fail/generic_without_via_rejection.stderr

+19-19
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ error: #[derive(FromRequest)] only supports generics when used with #[from_reque
55
| ^
66

77
error[E0277]: the trait bound `fn(Extractor<()>) -> impl Future<Output = ()> {foo}: Handler<_, _>` is not satisfied
8-
--> tests/from_request/fail/generic_without_via_rejection.rs:12:44
9-
|
10-
12 | _ = Router::<()>::new().route("/", get(foo));
11-
| --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}`
12-
| |
13-
| required by a bound introduced by this call
14-
|
15-
= note: Consider using `#[axum::debug_handler]` to improve the error message
16-
= help: the following other types implement trait `Handler<T, S>`:
17-
<Layered<L, H, T, S> as Handler<T, S>>
18-
<MethodRouter<S> as Handler<(), S>>
8+
--> tests/from_request/fail/generic_without_via_rejection.rs:12:44
9+
|
10+
12 | _ = Router::<()>::new().route("/", get(foo));
11+
| --- ^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Extractor<()>) -> impl Future<Output = ()> {foo}`
12+
| |
13+
| required by a bound introduced by this call
14+
|
15+
= note: Consider using `#[axum::debug_handler]` to improve the error message
16+
= help: the following other types implement trait `Handler<T, S>`:
17+
<Layered<L, H, T, S> as Handler<T, S>>
18+
<MethodRouter<S> as Handler<(), S>>
1919
note: required by a bound in `axum::routing::get`
20-
--> $WORKSPACE/axum/src/routing/method_routing.rs
21-
|
22-
| top_level_handler_fn!(get, GET);
23-
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
24-
| | |
25-
| | required by a bound in this function
26-
| required by this bound in `get`
27-
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
20+
--> $WORKSPACE/axum/src/routing/method_routing.rs
21+
|
22+
| top_level_handler_fn!(get, GET);
23+
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
24+
| | |
25+
| | required by a bound in this function
26+
| required by this bound in `get`
27+
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

axum-macros/tests/from_request/fail/override_rejection_on_enum_without_via.stderr

+38-38
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,45 @@ error: cannot use `rejection` without `via`
55
| ^^^^^^^^^
66

77
error[E0277]: the trait bound `fn(MyExtractor) -> impl Future<Output = ()> {handler}: Handler<_, _>` is not satisfied
8-
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:50
9-
|
10-
11 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
11-
| --- ^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(MyExtractor) -> impl Future<Output = ()> {handler}`
12-
| |
13-
| required by a bound introduced by this call
14-
|
15-
= note: Consider using `#[axum::debug_handler]` to improve the error message
16-
= help: the following other types implement trait `Handler<T, S>`:
17-
<Layered<L, H, T, S> as Handler<T, S>>
18-
<MethodRouter<S> as Handler<(), S>>
8+
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:50
9+
|
10+
11 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
11+
| --- ^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(MyExtractor) -> impl Future<Output = ()> {handler}`
12+
| |
13+
| required by a bound introduced by this call
14+
|
15+
= note: Consider using `#[axum::debug_handler]` to improve the error message
16+
= help: the following other types implement trait `Handler<T, S>`:
17+
<Layered<L, H, T, S> as Handler<T, S>>
18+
<MethodRouter<S> as Handler<(), S>>
1919
note: required by a bound in `axum::routing::get`
20-
--> $WORKSPACE/axum/src/routing/method_routing.rs
21-
|
22-
| top_level_handler_fn!(get, GET);
23-
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
24-
| | |
25-
| | required by a bound in this function
26-
| required by this bound in `get`
27-
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
20+
--> $WORKSPACE/axum/src/routing/method_routing.rs
21+
|
22+
| top_level_handler_fn!(get, GET);
23+
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
24+
| | |
25+
| | required by a bound in this function
26+
| required by this bound in `get`
27+
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
2828

2929
error[E0277]: the trait bound `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}: Handler<_, _>` is not satisfied
30-
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:64
31-
|
32-
11 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
33-
| ---- ^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}`
34-
| |
35-
| required by a bound introduced by this call
36-
|
37-
= note: Consider using `#[axum::debug_handler]` to improve the error message
38-
= help: the following other types implement trait `Handler<T, S>`:
39-
<Layered<L, H, T, S> as Handler<T, S>>
40-
<MethodRouter<S> as Handler<(), S>>
30+
--> tests/from_request/fail/override_rejection_on_enum_without_via.rs:11:64
31+
|
32+
11 | let _: Router = Router::new().route("/", get(handler).post(handler_result));
33+
| ---- ^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Result<MyExtractor, MyRejection>) -> impl Future<Output = ()> {handler_result}`
34+
| |
35+
| required by a bound introduced by this call
36+
|
37+
= note: Consider using `#[axum::debug_handler]` to improve the error message
38+
= help: the following other types implement trait `Handler<T, S>`:
39+
<Layered<L, H, T, S> as Handler<T, S>>
40+
<MethodRouter<S> as Handler<(), S>>
4141
note: required by a bound in `MethodRouter::<S>::post`
42-
--> $WORKSPACE/axum/src/routing/method_routing.rs
43-
|
44-
| chained_handler_fn!(post, POST);
45-
| ^^^^^^^^^^^^^^^^^^^^----^^^^^^^
46-
| | |
47-
| | required by a bound in this associated function
48-
| required by this bound in `MethodRouter::<S>::post`
49-
= note: this error originates in the macro `chained_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
42+
--> $WORKSPACE/axum/src/routing/method_routing.rs
43+
|
44+
| chained_handler_fn!(post, POST);
45+
| ^^^^^^^^^^^^^^^^^^^^----^^^^^^^
46+
| | |
47+
| | required by a bound in this associated function
48+
| required by this bound in `MethodRouter::<S>::post`
49+
= note: this error originates in the macro `chained_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

axum-macros/tests/from_request/fail/parts_extracting_body.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ error[E0277]: the trait bound `String: FromRequestParts<S>` is not satisfied
1515
<Uri as FromRequestParts<S>>
1616
<Version as FromRequestParts<S>>
1717
<Extensions as FromRequestParts<S>>
18-
and $N others
18+
and 29 others

axum-macros/tests/typed_path/fail/not_deserialize.stderr

+21-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,27 @@ error[E0277]: the trait bound `for<'de> MyPath: serde::de::Deserialize<'de>` is
1313
i32
1414
i64
1515
i128
16-
and $N others
16+
and 131 others
17+
= note: required for `MyPath` to implement `serde::de::DeserializeOwned`
18+
= note: required for `axum::extract::Path<MyPath>` to implement `FromRequestParts<S>`
19+
= note: this error originates in the derive macro `TypedPath` (in Nightly builds, run with -Z macro-backtrace for more info)
20+
21+
error[E0277]: the trait bound `for<'de> MyPath: serde::de::Deserialize<'de>` is not satisfied
22+
--> tests/typed_path/fail/not_deserialize.rs:3:10
23+
|
24+
3 | #[derive(TypedPath)]
25+
| ^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `MyPath`
26+
|
27+
= help: the following other types implement trait `serde::de::Deserialize<'de>`:
28+
bool
29+
char
30+
isize
31+
i8
32+
i16
33+
i32
34+
i64
35+
i128
36+
and 131 others
1737
= note: required for `MyPath` to implement `serde::de::DeserializeOwned`
1838
= note: required for `axum::extract::Path<MyPath>` to implement `FromRequestParts<S>`
1939
= note: this error originates in the derive macro `TypedPath` (in Nightly builds, run with -Z macro-backtrace for more info)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use axum_extra::routing::{TypedPath, RouterExt};
21
use axum::{extract::rejection::PathRejection, http::StatusCode};
2+
use axum_extra::routing::{RouterExt, TypedPath};
33
use serde::Deserialize;
44

55
#[derive(TypedPath, Deserialize)]
@@ -8,8 +8,6 @@ struct UsersShow {
88
id: String,
99
}
1010

11-
async fn option_handler(_: Option<UsersShow>) {}
12-
1311
async fn result_handler(_: Result<UsersShow, PathRejection>) {}
1412

1513
#[derive(TypedPath, Deserialize)]
@@ -20,7 +18,6 @@ async fn result_handler_unit_struct(_: Result<UsersIndex, StatusCode>) {}
2018

2119
fn main() {
2220
_ = axum::Router::<()>::new()
23-
.typed_get(option_handler)
2421
.typed_post(result_handler)
2522
.typed_post(result_handler_unit_struct);
2623
}

0 commit comments

Comments
 (0)