]> git.lizzy.rs Git - rust.git/commitdiff
Make normalize and normalize_to pub(crate)
authorMichael Goulet <michael@errs.io>
Fri, 25 Nov 2022 18:12:51 +0000 (18:12 +0000)
committerMichael Goulet <michael@errs.io>
Mon, 28 Nov 2022 17:35:39 +0000 (17:35 +0000)
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
compiler/rustc_trait_selection/src/traits/mod.rs
compiler/rustc_trait_selection/src/traits/project.rs

index e8468567cba0f9d220a6069a9df0181fcabbeaa9..f44d1d71fa66c4f748901e7c849876fbdf2a9f97 100644 (file)
@@ -1595,6 +1595,7 @@ fn report_projection_error(
                     bound_predicate.rebind(data),
                 );
                 let mut obligations = vec![];
+                // FIXME(normalization): Change this to use `At::normalize`
                 let normalized_ty = super::normalize_projection_type(
                     &mut selcx,
                     obligation.param_env,
index f038b294bd0fe113c6cdc01659660ce397e94bec..c6efbd6b684c058e65901d99951227d73b10e16b 100644 (file)
@@ -56,7 +56,8 @@
 pub use self::object_safety::is_vtable_safe_method;
 pub use self::object_safety::MethodViolationCode;
 pub use self::object_safety::ObjectSafetyViolation;
-pub use self::project::{normalize, normalize_projection_type, normalize_to, NormalizeExt};
+pub use self::project::{NormalizeExt, normalize_projection_type};
+pub(crate) use self::project::{normalize, normalize_to};
 pub use self::select::{EvaluationCache, SelectionCache, SelectionContext};
 pub use self::select::{EvaluationResult, IntercrateAmbiguityCause, OverflowError};
 pub use self::specialize::specialization_graph::FutureCompatOverlapError;
index 55db9277353e08ab66ddfbca8cca710a389bac34..7483b160f333e2c8c60c334fb746296eb6cb67ab 100644 (file)
@@ -307,7 +307,7 @@ fn project_and_unify_type<'cx, 'tcx>(
 /// them with a fully resolved type where possible. The return value
 /// combines the normalized result and any additional obligations that
 /// were incurred as result.
-pub fn normalize<'a, 'b, 'tcx, T>(
+pub(crate) fn normalize<'a, 'b, 'tcx, T>(
     selcx: &'a mut SelectionContext<'b, 'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     cause: ObligationCause<'tcx>,
@@ -321,7 +321,7 @@ pub fn normalize<'a, 'b, 'tcx, T>(
     Normalized { value, obligations }
 }
 
-pub fn normalize_to<'a, 'b, 'tcx, T>(
+pub(crate) fn normalize_to<'a, 'b, 'tcx, T>(
     selcx: &'a mut SelectionContext<'b, 'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     cause: ObligationCause<'tcx>,
@@ -335,7 +335,7 @@ pub fn normalize_to<'a, 'b, 'tcx, T>(
 }
 
 /// As `normalize`, but with a custom depth.
-pub fn normalize_with_depth<'a, 'b, 'tcx, T>(
+pub(crate) fn normalize_with_depth<'a, 'b, 'tcx, T>(
     selcx: &'a mut SelectionContext<'b, 'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     cause: ObligationCause<'tcx>,
@@ -351,7 +351,7 @@ pub fn normalize_with_depth<'a, 'b, 'tcx, T>(
 }
 
 #[instrument(level = "info", skip(selcx, param_env, cause, obligations))]
-pub fn normalize_with_depth_to<'a, 'b, 'tcx, T>(
+pub(crate) fn normalize_with_depth_to<'a, 'b, 'tcx, T>(
     selcx: &'a mut SelectionContext<'b, 'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     cause: ObligationCause<'tcx>,
@@ -371,7 +371,7 @@ pub fn normalize_with_depth_to<'a, 'b, 'tcx, T>(
 }
 
 #[instrument(level = "info", skip(selcx, param_env, cause, obligations))]
-pub fn try_normalize_with_depth_to<'a, 'b, 'tcx, T>(
+pub(crate) fn try_normalize_with_depth_to<'a, 'b, 'tcx, T>(
     selcx: &'a mut SelectionContext<'b, 'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     cause: ObligationCause<'tcx>,