diff --git a/core/codegen/src/attribute/catch.rs b/core/codegen/src/attribute/catch.rs index 158acac6..e01b29f1 100644 --- a/core/codegen/src/attribute/catch.rs +++ b/core/codegen/src/attribute/catch.rs @@ -127,7 +127,7 @@ pub fn _catch( fn from(_: #user_catcher_fn_name) -> #StaticCatcherInfo { fn monomorphized_function<'_b>( #status: #Status, - #req: &'_b #Request + #req: &'_b #Request<'_> ) -> #ErrorHandlerFuture<'_b> { #_Box::pin(async move { let __response = #catcher_response; diff --git a/core/codegen/src/attribute/route.rs b/core/codegen/src/attribute/route.rs index 2ab41f77..e8c1fa04 100644 --- a/core/codegen/src/attribute/route.rs +++ b/core/codegen/src/attribute/route.rs @@ -432,7 +432,7 @@ fn codegen_route(route: Route) -> Result { impl From<#user_handler_fn_name> for #StaticRouteInfo { fn from(_: #user_handler_fn_name) -> #StaticRouteInfo { fn monomorphized_function<'_b>( - #req: &'_b #Request, + #req: &'_b #Request<'_>, #data: #Data ) -> #HandlerFuture<'_b> { #_Box::pin(async move { diff --git a/examples/hello_2018/src/main.rs b/examples/hello_2018/src/main.rs index d73f65fc..eff09f18 100644 --- a/examples/hello_2018/src/main.rs +++ b/examples/hello_2018/src/main.rs @@ -1,3 +1,4 @@ +#![warn(rust_2018_idioms)] #[cfg(test)] mod tests; #[rocket::get("/")] @@ -9,3 +10,8 @@ fn hello() -> &'static str { fn rocket() -> rocket::Rocket { rocket::ignite().mount("/", rocket::routes![hello]) } + +#[rocket::catch(404)] +fn not_found(_req: &'_ rocket::Request<'_>) -> String { + "404 Not Found".to_owned() +}