diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-16 06:27:41 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-19 15:46:08 +0000 |
| commit | 21226eefb2e2465b9730c37e7d08655865610d90 (patch) | |
| tree | 9145dee39689d2d919b3a4aae366eaf763c0da47 /compiler/rustc_infer/src/traits/util.rs | |
| parent | fca56a8d2c6f803aeec51167dd4dd22529f8bdd7 (diff) | |
| download | rust-21226eefb2e2465b9730c37e7d08655865610d90.tar.gz rust-21226eefb2e2465b9730c37e7d08655865610d90.zip | |
Fully fledged Clause type
Diffstat (limited to 'compiler/rustc_infer/src/traits/util.rs')
| -rw-r--r-- | compiler/rustc_infer/src/traits/util.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/rustc_infer/src/traits/util.rs b/compiler/rustc_infer/src/traits/util.rs index 4f65a312c4e..00d4934b749 100644 --- a/compiler/rustc_infer/src/traits/util.rs +++ b/compiler/rustc_infer/src/traits/util.rs @@ -167,6 +167,26 @@ impl<'tcx> Elaboratable<'tcx> for (ty::Predicate<'tcx>, Span) { } } +impl<'tcx> Elaboratable<'tcx> for ty::Clause<'tcx> { + fn predicate(&self) -> ty::Predicate<'tcx> { + self.as_predicate() + } + + fn child(&self, predicate: ty::Predicate<'tcx>) -> Self { + predicate.as_clause().unwrap() + } + + fn child_with_derived_cause( + &self, + predicate: ty::Predicate<'tcx>, + _span: Span, + _parent_trait_pred: ty::PolyTraitPredicate<'tcx>, + _index: usize, + ) -> Self { + predicate.as_clause().unwrap() + } +} + pub fn elaborate<'tcx, O: Elaboratable<'tcx>>( tcx: TyCtxt<'tcx>, obligations: impl IntoIterator<Item = O>, |
