-
-
Notifications
You must be signed in to change notification settings - Fork 15k
support unboxed, uniquely typed closures #8622
Copy link
Copy link
Closed
Labels
A-codegenArea: Code generationArea: Code generationA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Type
Fields
Give feedbackNo fields configured for issues without a type.
It would need to be made obvious that these are generic functions/structs, because they won't be interchangeable.
Every closure would have either a unique type (like C++ closures) or at least a type based on the environment. A stack closure would start off as a bare moveable
fn(...)implementation able to be converted to boxed&fn(...),~fn(...)orRc<fn(...)>objects.An unboxed closure would just be static dispatch without a function pointer. As with traits, you would choose between static/dynamic dispatch.