diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-20 03:25:40 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-22 18:34:24 +0000 |
| commit | 471830b3a488b203e3bfde2e58eecad826287c2d (patch) | |
| tree | 6c8030dd00f679d0e6f8e0922e79fe23232e470b /compiler/rustc_middle/src/ty/mod.rs | |
| parent | 2fa796a3c796c819b53421577d5fd2e0f6a9f920 (diff) | |
| download | rust-471830b3a488b203e3bfde2e58eecad826287c2d.tar.gz rust-471830b3a488b203e3bfde2e58eecad826287c2d.zip | |
migrate inferred_outlives_of to Clause
Diffstat (limited to 'compiler/rustc_middle/src/ty/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 84ad96084c4..0e604fdf6f4 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -731,7 +731,7 @@ pub struct CratePredicatesMap<'tcx> { /// predicate of its outlive bounds. If an item has no outlives /// bounds, it will have no entry. // FIXME(clause): should this be a `Clause`? - pub predicates: FxHashMap<DefId, &'tcx [(ClauseKind<'tcx>, Span)]>, + pub predicates: FxHashMap<DefId, &'tcx [(Clause<'tcx>, Span)]>, } impl<'tcx> Predicate<'tcx> { @@ -1272,6 +1272,13 @@ impl<'tcx> ToPredicate<'tcx> for Clause<'tcx> { } } +impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for ClauseKind<'tcx> { + #[inline(always)] + fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Clause<'tcx> { + tcx.mk_predicate(Binder::dummy(ty::PredicateKind::Clause(self))).expect_clause() + } +} + impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for Binder<'tcx, ClauseKind<'tcx>> { #[inline(always)] fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Clause<'tcx> { |
