Auto merge of #123537 - compiler-errors:shallow, r=lcnr

Simplify shallow resolver to just fold ty/consts

Probably faster than using a whole folder?
This commit is contained in:
bors
2024-04-16 21:59:36 +00:00
13 changed files with 96 additions and 125 deletions

View File

@@ -198,7 +198,7 @@ impl<'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for NormalizationFolder<'_, 'tcx> {
#[instrument(level = "debug", skip(self), ret)]
fn try_fold_const(&mut self, ct: ty::Const<'tcx>) -> Result<ty::Const<'tcx>, Self::Error> {
let infcx = self.at.infcx;
debug_assert_eq!(ct, infcx.shallow_resolve(ct));
debug_assert_eq!(ct, infcx.shallow_resolve_const(ct));
if !ct.has_aliases() {
return Ok(ct);
}