From c3f7e02fb6ba3baa30bbbcf373f64ce0c48b1893 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Jun 2018 09:27:07 -0400 Subject: [PATCH] rename to `shrink_to_tcx_lifetime` --- src/librustc/traits/query/type_op/eq.rs | 2 +- src/librustc/traits/query/type_op/mod.rs | 4 ++-- src/librustc/traits/query/type_op/normalize.rs | 14 +++++++------- src/librustc/traits/query/type_op/outlives.rs | 2 +- .../traits/query/type_op/prove_predicate.rs | 2 +- src/librustc/traits/query/type_op/subtype.rs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/librustc/traits/query/type_op/eq.rs b/src/librustc/traits/query/type_op/eq.rs index fc5d174fff4b..7d05d0a2656f 100644 --- a/src/librustc/traits/query/type_op/eq.rs +++ b/src/librustc/traits/query/type_op/eq.rs @@ -48,7 +48,7 @@ impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for Eq<'tcx> { tcx.type_op_eq(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, ()>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, ()>> { v diff --git a/src/librustc/traits/query/type_op/mod.rs b/src/librustc/traits/query/type_op/mod.rs index b55c0de5b0bc..d89d31726cb5 100644 --- a/src/librustc/traits/query/type_op/mod.rs +++ b/src/librustc/traits/query/type_op/mod.rs @@ -72,7 +72,7 @@ pub trait QueryTypeOp<'gcx: 'tcx, 'tcx>: fmt::Debug + Sized { /// `QueryResult` is. This operation would (maybe) be nicer with /// something like HKTs or GATs, since then we could make /// `QueryResult` parametric and `'gcx` and `'tcx` etc. - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( lifted_query_result: &'a CanonicalizedQueryResult<'gcx, Self::QueryResult>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self::QueryResult>>; @@ -91,7 +91,7 @@ pub trait QueryTypeOp<'gcx: 'tcx, 'tcx>: fmt::Debug + Sized { let (canonical_self, canonical_var_values) = infcx.canonicalize_hr_query_hack(&query_key); let canonical_result = Self::perform_query(infcx.tcx, canonical_self)?; - let canonical_result = Self::cast_to_tcx_lifetime(&canonical_result); + let canonical_result = Self::shrink_to_tcx_lifetime(&canonical_result); let param_env = Self::param_env(&query_key); diff --git a/src/librustc/traits/query/type_op/normalize.rs b/src/librustc/traits/query/type_op/normalize.rs index 5e3a23a5f305..e4d27bccba3f 100644 --- a/src/librustc/traits/query/type_op/normalize.rs +++ b/src/librustc/traits/query/type_op/normalize.rs @@ -55,10 +55,10 @@ where T::type_op_method(tcx, canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, T>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, T>> { - T::cast_to_tcx_lifetime(v) + T::shrink_to_tcx_lifetime(v) } } @@ -70,7 +70,7 @@ pub trait Normalizable<'gcx, 'tcx>: fmt::Debug + TypeFoldable<'tcx> + Lift<'gcx> /// Convert from the `'gcx` (lifted) form of `Self` into the `tcx` /// form of `Self`. - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, Self>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self>>; } @@ -86,7 +86,7 @@ where tcx.type_op_normalize_ty(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, Self>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self>> { v @@ -104,7 +104,7 @@ where tcx.type_op_normalize_predicate(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, Self>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self>> { v @@ -122,7 +122,7 @@ where tcx.type_op_normalize_poly_fn_sig(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, Self>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self>> { v @@ -140,7 +140,7 @@ where tcx.type_op_normalize_fn_sig(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, Self>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self>> { v diff --git a/src/librustc/traits/query/type_op/outlives.rs b/src/librustc/traits/query/type_op/outlives.rs index 369cefdfb474..cfaed689126e 100644 --- a/src/librustc/traits/query/type_op/outlives.rs +++ b/src/librustc/traits/query/type_op/outlives.rs @@ -64,7 +64,7 @@ where tcx.dropck_outlives(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( lifted_query_result: &'a CanonicalizedQueryResult<'gcx, Self::QueryResult>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, Self::QueryResult>> { lifted_query_result diff --git a/src/librustc/traits/query/type_op/prove_predicate.rs b/src/librustc/traits/query/type_op/prove_predicate.rs index c610421e68a9..f54710c4805a 100644 --- a/src/librustc/traits/query/type_op/prove_predicate.rs +++ b/src/librustc/traits/query/type_op/prove_predicate.rs @@ -46,7 +46,7 @@ impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for ProvePredicate<'tcx> { tcx.type_op_prove_predicate(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, ()>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, ()>> { v diff --git a/src/librustc/traits/query/type_op/subtype.rs b/src/librustc/traits/query/type_op/subtype.rs index 8bb773b4c80d..e1589e1a9b68 100644 --- a/src/librustc/traits/query/type_op/subtype.rs +++ b/src/librustc/traits/query/type_op/subtype.rs @@ -52,7 +52,7 @@ impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for Subtype<'tcx> { tcx.type_op_subtype(canonicalized) } - fn cast_to_tcx_lifetime( + fn shrink_to_tcx_lifetime( v: &'a CanonicalizedQueryResult<'gcx, ()>, ) -> &'a Canonical<'tcx, QueryResult<'tcx, ()>> { v