Skip to content

Native async fn dynamic dispatch in traits #625

Description

@tomassedovic
Metadata
Point of contact @spastorino
Team(s) compiler, lang, types
Goal document 2026/afidt-box

Summary

Design and implement native support for async fn methods invoked through dyn trait objects.

Tasks and status


Note: we have updated the body to match the 2026 goal. Your original text is preserved below.

Details

Metadata
Point of contact @spastorino
Team(s) compiler, lang, types
Goal document 2026/afidt-box

Summary

Introduce .box notation and use it to enable dyn dispatch for traits with async methods. The initial scope is foo.method().box where method() returns a dyn-compatible RPITIT. In the future .box could be used more generally but before expanding it we would like to see progress on the work towards in-place initialization.

Needs contributor: @nikomatsakis is able to devote 1h/wk to support an experienced contributor or a cohort of contributors in driving this design forward as a lang experiment. This is a challenging problem that will require modifying various parts of the compiler and would also benefit from modeling in a-mir-formality.

Tasks and status

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions