rust/compiler/rustc_ast_lowering/src
bors 1ab783112a Auto merge of #119258 - compiler-errors:closure-kind, r=eholk
Make closures carry their own ClosureKind

Right now, we use the "`movability`" field of `hir::Closure` to distinguish a closure and a coroutine. This is paired together with the `CoroutineKind`, which is located not in the `hir::Closure`, but the `hir::Body`. This is strange and redundant.

This PR introduces `ClosureKind` with two variants -- `Closure` and `Coroutine`, which is put into `hir::Closure`. The `CoroutineKind` is thus removed from `hir::Body`, and `Option<Movability>` no longer needs to be a stand-in for "is this a closure or a coroutine".

r? eholk
2023-12-26 04:25:53 +00:00
..
asm.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
block.rs rustc_ast_lowering: remove ref patterns 2022-11-22 18:49:29 +00:00
errors.rs Disallow arm bodies on never patterns 2023-12-03 12:25:46 +01:00
expr.rs Auto merge of #119258 - compiler-errors:closure-kind, r=eholk 2023-12-26 04:25:53 +00:00
format.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
index.rs Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering) 2023-12-18 21:03:32 +01:00
item.rs Auto merge of #119258 - compiler-errors:closure-kind, r=eholk 2023-12-26 04:25:53 +00:00
lib.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
lifetime_collector.rs Reduce exposure of some things. 2023-11-28 14:32:40 +11:00
pat.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
path.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00