From 401f9b4e0a8ce709eb5d74fb291c04ce6f2fb505 Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 15 Oct 2024 18:03:25 +0200 Subject: `ImpliedOutlivesBounds` to `rustc_middle` --- compiler/rustc_middle/src/query/mod.rs | 12 ++++++------ compiler/rustc_middle/src/traits/query.rs | 8 ++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_middle') diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index f0be70e00df..dffb16f398c 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -65,8 +65,8 @@ use crate::query::plumbing::{ CyclePlaceholder, DynamicQuery, query_ensure, query_ensure_error_guaranteed, query_get_at, }; use crate::traits::query::{ - CanonicalAliasGoal, CanonicalPredicateGoal, CanonicalTyGoal, - CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpNormalizeGoal, + CanonicalAliasGoal, CanonicalImpliedOutlivesBoundsGoal, CanonicalPredicateGoal, + CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpNormalizeGoal, CanonicalTypeOpProvePredicateGoal, DropckConstraint, DropckOutlivesResult, MethodAutoderefStepsResult, NoSolution, NormalizationResult, OutlivesBound, }; @@ -2049,21 +2049,21 @@ rustc_queries! { } query implied_outlives_bounds_compat( - goal: CanonicalTyGoal<'tcx> + goal: CanonicalImpliedOutlivesBoundsGoal<'tcx> ) -> Result< &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec>>>, NoSolution, > { - desc { "computing implied outlives bounds for `{}`", goal.value.value } + desc { "computing implied outlives bounds for `{}`", goal.value.value.ty } } query implied_outlives_bounds( - goal: CanonicalTyGoal<'tcx> + goal: CanonicalImpliedOutlivesBoundsGoal<'tcx> ) -> Result< &'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec>>>, NoSolution, > { - desc { "computing implied outlives bounds v2 for `{}`", goal.value.value } + desc { "computing implied outlives bounds v2 for `{}`", goal.value.value.ty } } /// Do not call this query directly: diff --git a/compiler/rustc_middle/src/traits/query.rs b/compiler/rustc_middle/src/traits/query.rs index 81a543e647a..706848ae6de 100644 --- a/compiler/rustc_middle/src/traits/query.rs +++ b/compiler/rustc_middle/src/traits/query.rs @@ -70,6 +70,11 @@ pub mod type_op { Self { value } } } + + #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, HashStable, TypeFoldable, TypeVisitable)] + pub struct ImpliedOutlivesBounds<'tcx> { + pub ty: Ty<'tcx>, + } } pub type CanonicalAliasGoal<'tcx> = Canonical<'tcx, ty::ParamEnvAnd<'tcx, ty::AliasTy<'tcx>>>; @@ -92,6 +97,9 @@ pub type CanonicalTypeOpProvePredicateGoal<'tcx> = pub type CanonicalTypeOpNormalizeGoal<'tcx, T> = Canonical<'tcx, ty::ParamEnvAnd<'tcx, type_op::Normalize>>; +pub type CanonicalImpliedOutlivesBoundsGoal<'tcx> = + Canonical<'tcx, ty::ParamEnvAnd<'tcx, type_op::ImpliedOutlivesBounds<'tcx>>>; + #[derive(Clone, Debug, Default, HashStable, TypeFoldable, TypeVisitable)] pub struct DropckOutlivesResult<'tcx> { pub kinds: Vec>, -- cgit 1.4.1-3-g733a5