Skip to content

Commit

Permalink
Tweak placement of diagnostic on non-static lifetimes in source
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 27, 2020
1 parent a789be4 commit 464a409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion impl/src/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
));
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/lifetime.stderr
Original file line number Diff line number Diff line change
@@ -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>);
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^

0 comments on commit 464a409

Please sign in to comment.