1
Fork 0
rust/compiler/rustc_feature/src
bors 6153d3cbe6 Auto merge of #101212 - eholk:dyn-star, r=compiler-errors
Initial implementation of dyn*

This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). 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`
2022-09-14 18:10:51 +00:00
..
accepted.rs Stabilize GATs 2022-08-30 23:06:24 -04:00
active.rs Auto merge of #101212 - eholk:dyn-star, r=compiler-errors 2022-09-14 18:10:51 +00:00
builtin_attrs.rs Auto merge of #99556 - davidtwco:collapse-debuginfo, r=wesleywiser 2022-09-13 01:19:05 +00:00
lib.rs get_attr should check that no duplicates are allowed 2022-09-06 14:16:54 +08:00
removed.rs Remove register_attr feature 2022-08-28 21:23:23 +09:00
tests.rs tidy: Re-enable check for inline unit tests 2020-12-12 19:18:44 +03:00