-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
remove synthetic closure substs #92617
Copy link
Copy link
Open
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Metadata
Metadata
Assignees
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
TypeckResultsand 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