Refactor tcx mk_const parameters.

This commit is contained in:
Mateusz
2022-11-04 20:33:32 +00:00
parent 6330c27ae2
commit c97fd8183a
21 changed files with 74 additions and 104 deletions

View File

@@ -805,7 +805,7 @@ impl<'tcx> TypeSuperFoldable<'tcx> for ty::Const<'tcx> {
let ty = self.ty().try_fold_with(folder)?;
let kind = self.kind().try_fold_with(folder)?;
if ty != self.ty() || kind != self.kind() {
Ok(folder.tcx().mk_const(ty::ConstS { ty, kind }))
Ok(folder.tcx().mk_const(kind, ty))
} else {
Ok(self)
}