Repository navigation
[WIP] Make assoc item Coroutine::Yield a lending GAT -> Yield<'a>. - #163907
LorrensP-2158466 wants to merge 2 commits into
Conversation
|
Some changes occurred in compiler/rustc_attr_ir |
| } else if cx.is_projection_lang_item(def_id, SolverProjectionLangItem::CoroutineYield) { | ||
| ( | ||
| coroutine.yield_ty().into(), | ||
| ty::AliasTerm::new( | ||
| ecx.cx(), | ||
| goal.predicate.alias.kind, | ||
| [ | ||
| self_ty.into(), | ||
| coroutine.resume_ty().into(), | ||
| goal.predicate | ||
| .alias | ||
| .args | ||
| .iter() | ||
| .filter(|a| a.as_region().is_some()) | ||
| .next() | ||
| .unwrap(), | ||
| ], |
There was a problem hiding this comment.
I have absolutely no idea if this is how I insert that lifetime. but its the only way i could make it work.
if its correct, there is probably a nicer way :D
|
So with the tests, i mostly got away with usign HRTBs for the yield lifetimes. but some use stucts that borrow from and ofcourse the |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
as discussed on zulip, let's add the lifetime to the trait instead of the GAT while GATs are still a bit undersupported |
|
☔ The latest upstream changes (presumably #165493) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Attempts to implement #69268. related zulip discussion: #t-types/call-for-participation > looking for help with generalizing coroutine trait
PR makes the
Yieldassoc item ofCoroutinea GAT by using a lifetime, making it possible to return borrows from inside of the coroutine:Work in progress of course.
r? @oli-obk