-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from dtolnay/lifetime
Detect non-static lifetime behind reference type parameter
- Loading branch information
Showing
3 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
error: non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static | ||
--> $DIR/lifetime.rs:5:26 | ||
--> $DIR/lifetime.rs:6:26 | ||
| | ||
5 | struct Error<'a>(#[from] Inner<'a>); | ||
6 | struct Error<'a>(#[from] Inner<'a>); | ||
| ^^^^^^^^^ | ||
|
||
error: non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static | ||
--> $DIR/lifetime.rs:15:17 | ||
| | ||
15 | Foo(#[from] Generic<&'a str>), | ||
| ^^^^^^^^^^^^^^^^ |