rust/compiler/rustc_trait_selection/src/solve
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
..
assembly Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr 2023-06-21 07:37:01 +02:00
eval_ctxt split probe into 2 functions for better readability 2023-06-20 12:40:43 +02:00
inspect create module so that RUSTC_LOG can filter to just proof trees 2023-06-19 09:08:03 +01:00
search_graph dont use a trait 2023-06-19 09:01:37 +01:00
alias_relate.rs split probe into 2 functions for better readability 2023-06-20 12:40:43 +02:00
canonicalize.rs opportunistically resolve regions 2023-06-13 22:10:51 +00:00
eval_ctxt.rs Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr 2023-06-21 07:37:01 +02:00
fulfill.rs s/Clause/ClauseKind 2023-06-19 14:57:42 +00:00
inspect.rs inspect nits 2023-06-20 14:01:03 +02:00
mod.rs initial info dump 2023-06-19 09:01:37 +01:00
opaques.rs Don't consider TAIT normalizable to hidden ty if it would result in impossible item bounds 2023-06-19 14:49:56 +00:00
project_goals.rs Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr 2023-06-21 07:37:01 +02:00
trait_goals.rs Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr 2023-06-21 07:37:01 +02:00
weak_types.rs Add AliasKind::Weak for type aliases. 2023-06-16 19:39:48 +00:00