Skip to content

Commit

Permalink
Document global_alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 8, 2020
1 parent 43fcd7d commit b07a44d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_middle/mir/interpret/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ impl<'tcx> TyCtxt<'tcx> {

#[inline]
#[track_caller]
/// Panics in case the `AllocId` is dangling. Since that is impossible for `AllocId`s in
/// constants (as all constants must pass interning and validation that check for dangling
/// ids), this function is frequently used throughout rustc, but should not be used within
/// the miri engine.
pub fn global_alloc(&self, id: AllocId) -> GlobalAlloc<'tcx> {
match self.get_global_alloc(id) {
Some(alloc) => alloc,
Expand Down

0 comments on commit b07a44d

Please sign in to comment.