Minor cleanup

This commit is contained in:
John Kåre Alsaker 2018-03-15 10:01:17 +01:00
parent 37f9c7ff82
commit ec4a9c6b2f

View file

@ -1010,17 +1010,16 @@ impl<'tcx> InterpretInterner<'tcx> {
}
}
impl<'tcx> GlobalCtxt<'tcx> {
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
/// Get the global TyCtxt.
pub fn global_tcx<'a>(&'a self) -> TyCtxt<'a, 'tcx, 'tcx> {
#[inline]
pub fn global_tcx(self) -> TyCtxt<'a, 'gcx, 'gcx> {
TyCtxt {
gcx: self,
interners: &self.global_interners
gcx: self.gcx,
interners: &self.gcx.global_interners,
}
}
}
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
pub fn alloc_generics(self, generics: ty::Generics) -> &'gcx ty::Generics {
self.global_arenas.generics.alloc(generics)
}