rust/compiler/rustc_middle/src
Nilstrieb a98c14f3a9
Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind`

Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`).

1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`.
2. Add a new `Clause` type which is parallel to `Predicate`.
    * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸

The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that...

r? ``@lcnr`` or ``@oli-obk``

[^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-21 07:37:01 +02:00
..
dep_graph Allow LocalDefId as the argument to def_path_str 2023-04-21 22:27:20 +00:00
hir Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
infer opportunistically resolve regions 2023-06-13 22:10:51 +00:00
middle Remove const eval limit and implement an exponential backoff lint instead 2023-05-31 10:24:17 +00:00
mir Rollup merge of #112759 - cjgillot:closure-names, r=oli-obk 2023-06-21 07:37:01 +02:00
query Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr 2023-06-21 07:37:01 +02:00
thir offset_of 2023-04-21 02:14:02 -07:00
traits cleanup imports 2023-06-20 12:41:00 +02:00
ty Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr 2023-06-21 07:37:01 +02:00
util Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
arena.rs Make closure_saved_names_of_captured_variables a query. 2023-06-19 16:50:52 +00:00
error.rs Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
lib.rs s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
lint.rs Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
macros.rs Simplify CloneLiftImpls and TrivialTypeTraversalImpls. 2023-04-16 14:19:50 +10:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs
thir.rs Remove unused TypeFoldable/TypeVisitable impls. 2023-04-26 15:19:50 +10:00
values.rs EarlyBinder::new -> EarlyBinder::bind 2023-05-29 13:46:10 +02:00