Update span for FromRequest impls to point to callsite

This commit is contained in:
David Pedersen
2022-02-14 14:49:55 +01:00
parent 3ddefb4d84
commit 58ba5a2450
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ fn expand_named_fields(ident: &syn::Ident, path: LitStr, segments: &[Segment]) -
}
};
let from_request_impl = quote_spanned! {path.span()=>
let from_request_impl = quote! {
#[::axum::async_trait]
#[automatically_derived]
impl<B> ::axum::extract::FromRequest<B> for #ident
@@ -1,8 +1,9 @@
error[E0277]: the trait bound `for<'de> MyPath: serde::de::Deserialize<'de>` is not satisfied
--> tests/typed_path/fail/not_deserialize.rs:4:14
--> tests/typed_path/fail/not_deserialize.rs:3:10
|
4 | #[typed_path("/users/:id")]
| ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `MyPath`
3 | #[derive(TypedPath)]
| ^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `MyPath`
|
= note: required because of the requirements on the impl of `serde::de::DeserializeOwned` for `MyPath`
= note: required because of the requirements on the impl of `FromRequest<B>` for `axum::extract::Path<MyPath>`
= note: this error originates in the derive macro `TypedPath` (in Nightly builds, run with -Z macro-backtrace for more info)