rust/compiler/rustc_middle/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
..
dep_graph Allow query system to recover a HirId. 2022-10-01 15:58:42 +02:00
hir Move the untracked cstore and source_span into a struct 2022-12-09 14:53:24 +00:00
infer Add an optional Span to BrAnon and use it to print better error for HRTB error from generator interior 2022-11-07 17:39:29 -05:00
middle Move linkage type check to HIR analysis and fix semantics issues. 2022-12-05 15:05:43 -08:00
mir Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead 2022-12-11 09:51:57 +01:00
query Move the untracked cstore and source_span into a struct 2022-12-09 14:53:24 +00:00
thir
traits squash OpaqueTy and ProjectionTy into AliasTy 2022-12-13 17:40:27 +00:00
ty Auto merge of #104986 - compiler-errors:opaques, r=oli-obk 2022-12-14 01:19:24 +00:00
util
arena.rs Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser 2022-12-06 16:54:52 +01:00
error.rs Match crate and slug names 2022-11-21 15:24:50 +01:00
lib.rs Only allow feeding a value to newly created definitions. 2022-11-29 18:43:00 +00:00
lint.rs fix: typo 2022-11-06 11:22:29 -05:00
macros.rs add inline to TrivialTypeTraversalImpls 2022-10-17 10:54:03 +02:00
metadata.rs
tests.rs
thir.rs Unreserve braced enum variants in value namespace 2022-11-21 22:40:06 +03:00
values.rs Properly synthesize fn sig value during cycle 2022-12-01 23:56:57 -05:00