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:
parent
3bf00450cb
commit
e1377a4f47
27 changed files with 85 additions and 55 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue