remove synthetic closure substs #92617
Labels
A-closures
Area: closures (`|args| { .. }`)
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
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
cc @nikomatsakis
The text was updated successfully, but these errors were encountered: