Skip to main content

Module mir_storage

Module mir_storage 

Source
Expand description

This module allows storing mir bodies with borrowck facts in a thread-local storage. Unfortunately, thread local storage requires all data stored in it to have a 'static lifetime. Therefore, we transmute the lifetime 'tcx away when storing the data. To ensure that nothing gets meessed up, we require the client to provide a witness: an instance of type TyCtxt<'tcx> that is used to show that the lifetime that the client provided is indeed 'tcx.

Constants§

SHARED_STATE

Functions§

retrieve_mir_body
Safety
store_mir_body
Safety
try_retrieve_mir_body
Like retrieve_mir_body, but returns None instead of panicking when no body was stashed for def_id (e.g. a local item rustc never borrowchecks). The no-panic call-graph provider uses this to degrade such items to leaf nodes.