rust/compiler/rustc_ast/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
..
attr Rollup merge of #101752 - GuillaumeGomez:improve-attr-docs, r=lqd 2022-09-13 22:25:35 +02:00
expand Make allocator_kind a query. 2021-06-20 11:52:51 +02:00
util Rollup merge of #100767 - kadiwa4:escape_ascii, r=jackh726 2022-09-12 15:21:30 +05:30
ast.rs Auto merge of #101212 - eholk:dyn-star, r=compiler-errors 2022-09-14 18:10:51 +00:00
ast_traits.rs Rename {Create,Lazy}TokenStream as {To,Lazy}AttrTokenStream. 2022-09-09 17:25:38 +10:00
entry.rs Fixup missing renames from #[main] to #[rustc_main] 2022-06-22 18:24:09 +02:00
lib.rs Inline and remove TokenStream::opt_from_ast. 2022-09-09 16:53:17 +10:00
mut_visit.rs Rename {Create,Lazy}TokenStream as {To,Lazy}AttrTokenStream. 2022-09-09 17:25:38 +10:00
node_id.rs rustc_error, rustc_private, rustc_ast: Switch to stable hash containers 2022-09-10 11:49:12 +02:00
ptr.rs Use delayed error handling for Encodable and Encoder infallible. 2022-06-08 07:01:26 +10:00
token.rs fix #101626, suggest pub instead of public for const type item 2022-09-11 08:29:38 +08:00
tokenstream.rs Rename {Create,Lazy}TokenStream as {To,Lazy}AttrTokenStream. 2022-09-09 17:25:38 +10:00
visit.rs Remove unused span argument from walk_fn. 2022-09-12 13:24:27 +10:00