move closure kind, signature into `ClosureSubsts`
Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects:
- It means that the closure's type changes as inference finds out more things, which is very nice.
- As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators).
- It avoids cyclic closures calls.
- These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410).
We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed.
r? @arielb1
|
||
|---|---|---|
| .. | ||
| caching_codemap_view.rs | ||
| fingerprint.rs | ||
| hcx.rs | ||
| impls_const_math.rs | ||
| impls_cstore.rs | ||
| impls_hir.rs | ||
| impls_mir.rs | ||
| impls_misc.rs | ||
| impls_syntax.rs | ||
| impls_ty.rs | ||
| mod.rs | ||