Skip to content

Commit

Permalink
Shrink visibility of the AllocMap and its methods
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 8, 2020
1 parent 1037f40 commit 4572d32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_middle/mir/interpret/mod.rs
Expand Up @@ -401,7 +401,7 @@ impl GlobalAlloc<'tcx> {
}
}

pub struct AllocMap<'tcx> {
crate struct AllocMap<'tcx> {
/// Maps `AllocId`s to their corresponding allocations.
alloc_map: FxHashMap<AllocId, GlobalAlloc<'tcx>>,

Expand All @@ -417,10 +417,10 @@ pub struct AllocMap<'tcx> {
}

impl<'tcx> AllocMap<'tcx> {
pub fn new() -> Self {
crate fn new() -> Self {
AllocMap { alloc_map: Default::default(), dedup: Default::default(), next_id: AllocId(0) }
}
pub fn reserve(&mut self) -> AllocId {
fn reserve(&mut self) -> AllocId {
let next = self.next_id;
self.next_id.0 = self.next_id.0.checked_add(1).expect(
"You overflowed a u64 by incrementing by 1... \
Expand Down

0 comments on commit 4572d32

Please sign in to comment.