1
Fork 0

compiler: fold by value

This commit is contained in:
Bastian Kauschke 2020-10-24 02:21:18 +02:00
parent 3ec6720bf1
commit 2bf93bd852
140 changed files with 679 additions and 699 deletions

View file

@ -19,7 +19,7 @@ use super::NoSolution;
pub use rustc_middle::traits::query::NormalizationResult;
pub trait AtExt<'tcx> {
fn normalize<T>(&self, value: &T) -> Result<Normalized<'tcx, T>, NoSolution>
fn normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
where
T: TypeFoldable<'tcx>;
}
@ -38,7 +38,7 @@ impl<'cx, 'tcx> AtExt<'tcx> for At<'cx, 'tcx> {
/// normalizing, but for now should be used only when we actually
/// know that normalization will succeed, since error reporting
/// and other details are still "under development".
fn normalize<T>(&self, value: &T) -> Result<Normalized<'tcx, T>, NoSolution>
fn normalize<T>(&self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
where
T: TypeFoldable<'tcx>,
{
@ -165,7 +165,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
// so we cannot canonicalize it.
let c_data = self
.infcx
.canonicalize_hr_query_hack(&self.param_env.and(*data), &mut orig_values);
.canonicalize_hr_query_hack(self.param_env.and(*data), &mut orig_values);
debug!("QueryNormalizer: c_data = {:#?}", c_data);
debug!("QueryNormalizer: orig_values = {:#?}", orig_values);
match tcx.normalize_projection_ty(c_data) {