diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-06-21 07:37:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-21 07:37:01 +0200 |
| commit | 6d4c2573e77a6b6f36a064d2c21a3c9709bb091b (patch) | |
| tree | 31ebd758ff1d7ffdb381ae55d2c832c0337ee7d8 /compiler/rustc_mir_transform/src/coverage/debug.rs | |
| parent | 9a65f469e07fa8a9158b6ab3b7f7ee941da04380 (diff) | |
| parent | b2c7ce89089437a004682cede27aa59a8726eeeb (diff) | |
| download | rust-6d4c2573e77a6b6f36a064d2c21a3c9709bb091b.tar.gz rust-6d4c2573e77a6b6f36a064d2c21a3c9709bb091b.zip | |
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
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions
