avoid calling mk_region unnecessarily

this improves typeck & trans performance by 1%. This looked hotter on
callgrind than it is on a CPU.
This commit is contained in:
Ariel Ben-Yehuda 2017-04-20 01:58:12 +03:00 committed by Ariel Ben-Yehuda
parent 3bf00450cb
commit e1377a4f47
27 changed files with 85 additions and 55 deletions

View file

@ -343,12 +343,12 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
}
pub fn t_rptr_static(&self) -> Ty<'tcx> {
self.infcx.tcx.mk_imm_ref(self.infcx.tcx.mk_region(ty::ReStatic),
self.infcx.tcx.mk_imm_ref(self.infcx.tcx.types.re_static,
self.tcx().types.isize)
}
pub fn t_rptr_empty(&self) -> Ty<'tcx> {
self.infcx.tcx.mk_imm_ref(self.infcx.tcx.mk_region(ty::ReEmpty),
self.infcx.tcx.mk_imm_ref(self.infcx.tcx.types.re_empty,
self.tcx().types.isize)
}