Skip to content

remove synthetic closure substs #92617

Open
@lcnr

Description

@lcnr

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

Metadata

Metadata

Assignees

Labels

A-closuresArea: Closures (`|…| { … }`)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions