Skip to content

Commit b07a44d

Browse files
committed
Document global_alloc
1 parent 43fcd7d commit b07a44d

File tree

1 file changed

+4
-0
lines changed
  • src/librustc_middle/mir/interpret

1 file changed

+4
-0
lines changed

src/librustc_middle/mir/interpret/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ impl<'tcx> TyCtxt<'tcx> {
515515

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

0 commit comments

Comments
 (0)