We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
global_alloc
1 parent 43fcd7d commit b07a44dCopy full SHA for b07a44d
src/librustc_middle/mir/interpret/mod.rs
@@ -515,6 +515,10 @@ impl<'tcx> TyCtxt<'tcx> {
515
516
#[inline]
517
#[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.
522
pub fn global_alloc(&self, id: AllocId) -> GlobalAlloc<'tcx> {
523
match self.get_global_alloc(id) {
524
Some(alloc) => alloc,
0 commit comments