diff --git a/impl/src/valid.rs b/impl/src/valid.rs index ab20423..145e96d 100644 --- a/impl/src/valid.rs +++ b/impl/src/valid.rs @@ -190,7 +190,7 @@ fn check_field_attrs(fields: &[Field]) -> Result<()> { if let Some(source_field) = source_field.or(from_field) { if contains_non_static_lifetime(source_field) { return Err(Error::new_spanned( - source_field.original, + &source_field.original.ty, "non-static lifetimes are not allowed in the source of an error", )); } diff --git a/tests/ui/lifetime.stderr b/tests/ui/lifetime.stderr index 500f6ab..36c0105 100644 --- a/tests/ui/lifetime.stderr +++ b/tests/ui/lifetime.stderr @@ -1,5 +1,5 @@ error: non-static lifetimes are not allowed in the source of an error - --> $DIR/lifetime.rs:5:18 + --> $DIR/lifetime.rs:5:26 | 5 | struct Error<'a>(#[from] Inner<'a>); - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^