Open
Description
right now, we add synthetic generic parameters to closures to represent a bunch of additional information about the closure, see
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/sty/struct.ClosureSubsts.html
These substs don't behave like ordinary generic parameters, negatively impact perf and are difficult to understand or deal with in some cases.
We should try to remove these synthetic parameters, for example by moving them into TypeckResults
and treating closures a lot more similar to ordinary adts. The same approach should also be used for generators and inline consts.
Going to look into this myself for now