rust/compiler/rustc_ty_utils/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
..
abi.rs Only regular coroutines have movability 2023-12-25 21:13:41 +00:00
assoc.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
common_traits.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
consts.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
errors.rs Re-use error code for duplicate error 2023-06-22 15:51:14 +00:00
implied_bounds.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
instance.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
layout.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
layout_sanity_check.rs fix failure to detect a too-big-type after adding padding 2023-10-27 18:07:53 +02:00
lib.rs Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
needs_drop.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
opaque_types.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
representability.rs Reduce exposure of some items. 2023-11-20 14:10:19 +11:00
sig_types.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
structural_match.rs Reduce exposure of some items. 2023-11-20 14:10:19 +11:00
ty.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00