Tweak placement of diagnostic on non-static lifetimes in source

This commit is contained in:
David Tolnay 2020-12-26 17:25:34 -08:00
parent a789be4219
commit 464a409608
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 3 additions and 3 deletions

View File

@ -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",
));
}

View File

@ -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>);
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^