-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement assumed_wf_types for RPITITs' implementations
- Loading branch information
1 parent
349a237
commit 50d2109
Showing
6 changed files
with
102 additions
and
33 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// check-pass | ||
// edition: 2021 | ||
// issue: 113796 | ||
|
||
#![feature(async_fn_in_trait)] | ||
|
||
trait AsyncLendingIterator { | ||
type Item<'a> | ||
where | ||
Self: 'a; | ||
|
||
async fn next(&mut self) -> Option<Self::Item<'_>>; | ||
} | ||
|
||
struct Lend<I>(I); | ||
impl<I> AsyncLendingIterator for Lend<I> { | ||
type Item<'a> = &'a I | ||
where | ||
Self: 'a; | ||
|
||
// Checking that the synthetic `<Self as AsyncLendingIterator>::next()` GAT | ||
// is well-formed requires being able to assume the WF types of `next`. | ||
|
||
async fn next(&mut self) -> Option<Self::Item<'_>> { | ||
todo!() | ||
} | ||
} | ||
|
||
fn main() {} |