rust/compiler/rustc_codegen_ssa/src
bors 918d0ac38e Auto merge of #104986 - compiler-errors:opaques, r=oli-obk
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias`

Implements https://github.com/rust-lang/types-team/issues/79.

This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so:

```
enum AliasKind {
  Projection,
  Opaque,
}

struct AliasTy<'tcx> {
  def_id: DefId,
  substs: SubstsRef<'tcx>,
}
```

Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example:

```diff
  match ty.kind() {
-   ty::Opaque(..) =>
+   ty::Alias(ty::Opaque, ..) => {}
    _ => {}
  }
```

This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically.

r? `@ghost`
2022-12-14 01:19:24 +00:00
..
back Rollup merge of #105423 - oli-obk:symbols, r=jackh726 2022-12-08 12:57:32 +01:00
coverageinfo Remove in_band_lifetimes from rustc_codegen_ssa 2021-12-15 00:41:41 -05:00
debuginfo Combine identical alias arms 2022-12-13 17:48:55 +00:00
mir Auto merge of #105252 - bjorn3:codegen_less_pair_values, r=nagisa 2022-12-12 10:38:31 +00:00
traits Auto merge of #105252 - bjorn3:codegen_less_pair_values, r=nagisa 2022-12-12 10:38:31 +00:00
base.rs compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
codegen_attrs.rs Move some codegen-y methods from rustc_hir_analysis::collect -> rustc_codegen_ssa 2022-12-13 05:01:36 +00:00
common.rs Simplify cast_shift_expr_rhs. 2022-10-25 14:39:20 +11:00
errors.rs Move some codegen-y methods from rustc_hir_analysis::collect -> rustc_codegen_ssa 2022-12-13 05:01:36 +00:00
glue.rs add is_sized method on Abi and Layout, and use it 2022-11-13 12:23:53 +01:00
lib.rs Move some codegen-y methods from rustc_hir_analysis::collect -> rustc_codegen_ssa 2022-12-13 05:01:36 +00:00
meth.rs Directly return loaded value from type_checked_load 2022-12-03 18:27:43 +00:00
mono_item.rs Store a LocalDefId in hir::AnonConst. 2022-11-13 14:06:11 +00:00
target_features.rs Move some codegen-y methods from rustc_hir_analysis::collect -> rustc_codegen_ssa 2022-12-13 05:01:36 +00:00