Rollup merge of #72822 - lcnr:intern-me, r=estebank
remove trivial calls to mk_const similar to #72754
This commit is contained in:
commit
f1732f66ff
1 changed files with 5 additions and 1 deletions
|
@ -1019,7 +1019,11 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::Const<'tcx> {
|
|||
fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {
|
||||
let ty = self.ty.fold_with(folder);
|
||||
let val = self.val.fold_with(folder);
|
||||
folder.tcx().mk_const(ty::Const { ty, val })
|
||||
if ty != self.ty || val != self.val {
|
||||
folder.tcx().mk_const(ty::Const { ty, val })
|
||||
} else {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
fn fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue