Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 17, 2018
1 parent 37f9c7f commit ec4a9c6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit ec4a9c6

Please sign in to comment.