Skip to main content

rustc_public_bridge/context/
helpers.rs

1//! A set of traits that define a stable interface to rustc's internals.
2//!
3//! These traits abstract rustc's internal APIs, allowing rustc_public to maintain a stable
4//! interface regardless of internal compiler changes.
5
6use rustc_middle::mir::interpret::AllocRange;
7use rustc_middle::ty::Ty;
8use rustc_span::def_id::DefId;
9
10pub trait TyHelpers<'tcx> {
11    fn new_foreign(&self, def_id: DefId) -> Ty<'tcx>;
12}
13
14pub trait AllocRangeHelpers<'tcx> {
15    fn alloc_range(&self, offset: rustc_abi::Size, size: rustc_abi::Size) -> AllocRange;
16}