mirror of https://github.com/fafhrd91/actix-web
fix macro error regression
This commit is contained in:
parent
1da77b5efa
commit
d414cd93a5
|
@ -349,13 +349,14 @@ pub(crate) fn with_method(
|
||||||
|
|
||||||
let ast = match syn::parse::<syn::ItemFn>(input.clone()) {
|
let ast = match syn::parse::<syn::ItemFn>(input.clone()) {
|
||||||
Ok(ast) => ast,
|
Ok(ast) => ast,
|
||||||
// on parse err, make IDEs happy; see fn docs
|
// on parse error, make IDEs happy; see fn docs
|
||||||
Err(err) => return input_and_compile_error(input, err),
|
Err(err) => return input_and_compile_error(input, err),
|
||||||
};
|
};
|
||||||
|
|
||||||
match Route::new(args, ast, method) {
|
match Route::new(args, ast, method) {
|
||||||
Ok(route) => route.into_token_stream().into(),
|
Ok(route) => route.into_token_stream().into(),
|
||||||
Err(err) => err.into_compile_error().into(),
|
// on macro related error, make IDEs happy; see fn docs
|
||||||
|
Err(err) => input_and_compile_error(input, err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ error: HTTP method defined more than once: `GET`
|
||||||
3 | #[route("/", method="GET", method="GET")]
|
3 | #[route("/", method="GET", method="GET")]
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
||||||
error[E0425]: cannot find value `index` in this scope
|
error[E0277]: the trait bound `fn() -> impl std::future::Future {index}: HttpServiceFactory` is not satisfied
|
||||||
--> $DIR/route-duplicate-method-fail.rs:12:55
|
--> $DIR/route-duplicate-method-fail.rs:12:55
|
||||||
|
|
|
|
||||||
12 | let srv = actix_test::start(|| App::new().service(index));
|
12 | let srv = actix_test::start(|| App::new().service(index));
|
||||||
| ^^^^^ not found in this scope
|
| ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future {index}`
|
||||||
|
|
|
@ -6,8 +6,8 @@ error: The #[route(..)] macro requires at least one `method` attribute
|
||||||
|
|
|
|
||||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error[E0425]: cannot find value `index` in this scope
|
error[E0277]: the trait bound `fn() -> impl std::future::Future {index}: HttpServiceFactory` is not satisfied
|
||||||
--> $DIR/route-missing-method-fail.rs:12:55
|
--> $DIR/route-missing-method-fail.rs:12:55
|
||||||
|
|
|
|
||||||
12 | let srv = actix_test::start(|| App::new().service(index));
|
12 | let srv = actix_test::start(|| App::new().service(index));
|
||||||
| ^^^^^ not found in this scope
|
| ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future {index}`
|
||||||
|
|
|
@ -4,8 +4,8 @@ error: Unexpected HTTP method: `UNEXPECTED`
|
||||||
3 | #[route("/", method="UNEXPECTED")]
|
3 | #[route("/", method="UNEXPECTED")]
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0425]: cannot find value `index` in this scope
|
error[E0277]: the trait bound `fn() -> impl std::future::Future {index}: HttpServiceFactory` is not satisfied
|
||||||
--> $DIR/route-unexpected-method-fail.rs:12:55
|
--> $DIR/route-unexpected-method-fail.rs:12:55
|
||||||
|
|
|
|
||||||
12 | let srv = actix_test::start(|| App::new().service(index));
|
12 | let srv = actix_test::start(|| App::new().service(index));
|
||||||
| ^^^^^ not found in this scope
|
| ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future {index}`
|
||||||
|
|
Loading…
Reference in New Issue