Skip to content

Initial implementation of dyn*#101212

Merged
bors merged 16 commits intorust-lang:masterfrom
eholk:dyn-star
Sep 14, 2022
Merged

Initial implementation of dyn*#101212
bors merged 16 commits intorust-lang:masterfrom
eholk:dyn-star

Conversation

@eholk
Copy link
Contributor

@eholk eholk commented Aug 30, 2022

This PR adds extremely basic and incomplete support for dyn*. The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things:

  • Introduce dyn_star feature flag
  • Adds parsing for dyn* Trait types
  • Defines dyn* Trait as a sized type
  • Adds support for explicit casts, like 42usize as dyn* Debug
    • Including const evaluation of such casts
  • Adds codegen for drop glue so things are cleaned up properly when a dyn* Trait object goes out of scope
  • Adds codegen for method calls, at least for methods that take &self

Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather dyn* is planned to be used as an implementation detail for async functions in dyn traits.

Joint work with @nikomatsakis and @compiler-errors.

r? @bjorn3

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-dyn_star `#![feature(dyn_star)]` merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.