Stream: t-compiler

Topic: #54045 where to nest existential type


nikomatsakis (Sep 13 2018 at 14:51, on Zulip):

Chatting with @eddyb, they wrote:

whereas I prefer the hir::Ty node being the parent of the existential type item

eddyb (Sep 13 2018 at 14:52, on Zulip):

I want to get rid of "only module children and statements can be items", tbh

nikomatsakis (Sep 13 2018 at 14:52, on Zulip):

yes, I don't love that distinction :)

eddyb (Sep 13 2018 at 14:53, on Zulip):

the HIR doesn't need AST's strong distinctions, e.g. extern { fn foo(); } can just use the same "item" type for foo, just a ForeignFn variant instead of Fn, let's say

nikomatsakis (Sep 13 2018 at 14:53, on Zulip):

right

nikomatsakis (Sep 13 2018 at 14:56, on Zulip):

I guess I have to look a bit at the code... it seems like nesting the "impl Trait" inside the fn / type / some fresh anonymous container are all pretty similar. I see the appeal to the "anonymous module", in that it makes the "scope" of the impl trait most analogous to an explicit existential type, but I'm not convinced that's important.

Last update: Nov 16 2019 at 01:05UTC