Remove ParamEnvAnd::into_parts.

The fields are public, so this doesn't need a method, normal
deconstruction and/or field access is good enough.
This commit is contained in:
Nicholas Nethercote
2025-07-31 09:02:15 +10:00
parent c4e3cc0228
commit a949c47f0d
6 changed files with 8 additions and 14 deletions

View File

@@ -7,7 +7,7 @@ use rustc_infer::infer::canonical::{self, Canonical};
use rustc_infer::traits::query::OutlivesBound;
use rustc_infer::traits::query::type_op::ImpliedOutlivesBounds;
use rustc_middle::query::Providers;
use rustc_middle::ty::TyCtxt;
use rustc_middle::ty::{ParamEnvAnd, TyCtxt};
use rustc_span::DUMMY_SP;
use rustc_trait_selection::infer::InferCtxtBuilderExt;
use rustc_trait_selection::traits::query::type_op::implied_outlives_bounds::compute_implied_outlives_bounds_inner;
@@ -25,7 +25,7 @@ fn implied_outlives_bounds<'tcx>(
NoSolution,
> {
tcx.infer_ctxt().enter_canonical_trait_query(&goal, |ocx, key| {
let (param_env, ImpliedOutlivesBounds { ty }) = key.into_parts();
let ParamEnvAnd { param_env, value: ImpliedOutlivesBounds { ty } } = key;
compute_implied_outlives_bounds_inner(
ocx,
param_env,

View File

@@ -43,7 +43,7 @@ fn type_op_normalize<'tcx, T>(
where
T: fmt::Debug + TypeFoldable<TyCtxt<'tcx>>,
{
let (param_env, Normalize { value }) = key.into_parts();
let ParamEnvAnd { param_env, value: Normalize { value } } = key;
let Normalized { value, obligations } =
ocx.infcx.at(&ObligationCause::dummy(), param_env).query_normalize(value)?;
ocx.register_obligations(obligations);
@@ -96,6 +96,6 @@ pub fn type_op_prove_predicate_with_cause<'tcx>(
key: ParamEnvAnd<'tcx, ProvePredicate<'tcx>>,
cause: ObligationCause<'tcx>,
) {
let (param_env, ProvePredicate { predicate }) = key.into_parts();
let ParamEnvAnd { param_env, value: ProvePredicate { predicate } } = key;
ocx.register_obligation(Obligation::new(ocx.infcx.tcx, cause, param_env, predicate));
}