Regarding https://github.com/rust-analyzer/rust-analyzer/issues/7432 which just popped up, I wonder how would we go about lowering these const expressions in type param position? I remember having that question in my head when I added them to the HIR. Technically those expressions are bodies right? Which means we would have to lower them lazily but that seems to go against the fact that types are lowered eagerly right?
good question. I do think we could lower them lazily; the type would only contain the ID of the expression (body) anyway
we do need a place to put them, give them IDs and find them again though, which isn't so easy since they can appear everywhere
those bodies could even contain local functions and modules :sweat_smile:
Oh no, that sounds just lovely :sweat_smile:
So this might be relevant to the DefMap stuff as well then? Since Jonas Schievink is working on that part to support local items it might be good to keep that in mind
hmm, yeah, tricky
Currently we can compute a
Body for any
DefWithBodyId, which is just functions, statics and consts
We'd have to extend that to be nestable inside types
Possibly by an
AstId-like scheme but for these expression roots?
urgh, if only salsa had an