-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the RFC3498 Captures Trick for lifetimes.
I finally took the time to squint at this RFC, understand the problem, and then apply the solution here. What I had before was wrong in subtle ways that had caused me to overcomplicate some things in the past -- it would tend to put weird constraints on generic types or lifetimes that would lead to weird compile errors. Fortunately, it was "wrong" in the sense that valid programs wouldn't compile, not in the sense that it allowed bugs. This commit adds a Captures trait to util and uses it to do lifetime and parameter capture in the best way available in the 2021 edition.
- Loading branch information
Showing
3 changed files
with
23 additions
and
20 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