Stream: wg-traits

Topic: GATs-status


scalexm (Nov 12 2018 at 22:34, on Zulip):

@Alexander Regueiro at least we know how they will work in practice, i.e. with respect to type checking et al, but I don’t know if they are any plans to make progress on them outside of pushing on chalk integration

Alexander Regueiro (Nov 12 2018 at 22:35, on Zulip):

@scalexm so is there more work to be done to get them working even once chalk lands?

scalexm (Nov 12 2018 at 22:35, on Zulip):

@Alexander Regueiro well I guess yes, since the syntax isn't even fully implemented in rustc

scalexm (Nov 12 2018 at 22:36, on Zulip):

e.g. where clauses on associated types

scalexm (Nov 12 2018 at 22:36, on Zulip):

which the parser does not accept yet

scalexm (Nov 12 2018 at 22:37, on Zulip):

but anyway I guess they should be "easily" implementable in rustc once chalk has a decent support

Alexander Regueiro (Nov 12 2018 at 22:37, on Zulip):

@scalexm I see...

Alexander Regueiro (Nov 12 2018 at 22:37, on Zulip):

@scalexm and is this a blocker to RPIT in traits?

scalexm (Nov 12 2018 at 22:39, on Zulip):

@Alexander Regueiro no, but they are a blocker to async functions in traits if they need to borrow data

scalexm (Nov 12 2018 at 22:40, on Zulip):

e.g. async fn foo(&self) is really fn foo<'a>(&'a self) -> impl Future<Item = ()> + 'a

scalexm (Nov 12 2018 at 22:40, on Zulip):

so the return type is an existential type which is parametric over a lifetime

scalexm (Nov 12 2018 at 22:40, on Zulip):

which you cannot express inside a trait right now because it would be a GAT

Alexander Regueiro (Nov 12 2018 at 22:56, on Zulip):

aha

Alexander Regueiro (Nov 12 2018 at 22:56, on Zulip):

makes sense

Alexander Regueiro (Nov 12 2018 at 22:56, on Zulip):

@scalexm is there any reason we haven't implemented RPIT in traits yet then?

scalexm (Nov 12 2018 at 23:22, on Zulip):

@Alexander Regueiro I don’t know of any, especially since I think existential associated type values are already usable in nightly

scalexm (Nov 12 2018 at 23:22, on Zulip):

Members of the lang team may know best

Alexander Regueiro (Nov 12 2018 at 23:24, on Zulip):

@scalexm indeed, I thought the same. I figured it's about time to add support for it!

Alexander Regueiro (Nov 12 2018 at 23:24, on Zulip):

thanks anyway

Alexander Regueiro (Nov 12 2018 at 23:25, on Zulip):

I'll double check with a lang/compiler-team member

Last update: Nov 12 2019 at 16:50UTC