Rollup merge of #129309 - RalfJung:CompileTimeInterpCx, r=compiler-errors

ctfe: make CompileTimeInterpCx type alias public

`CompileTimeMachine` is already public so there is no good reason to not also make this public.

Also add comment explaining why `CompileTimeMachine` is public.
This commit is contained in:
Matthias Krüger 2024-08-20 22:21:59 +02:00 committed by GitHub
commit b1f19caa59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,10 @@ const TINY_LINT_TERMINATOR_LIMIT: usize = 20;
/// power of two of interpreted terminators.
const PROGRESS_INDICATOR_START: usize = 4_000_000;
/// Extra machine state for CTFE, and the Machine instance
/// Extra machine state for CTFE, and the Machine instance.
//
// Should be public because out-of-tree rustc consumers need this
// if they want to interact with constant values.
pub struct CompileTimeMachine<'tcx> {
/// The number of terminators that have been evaluated.
///
@ -160,7 +163,7 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
}
}
pub(crate) type CompileTimeInterpCx<'tcx> = InterpCx<'tcx, CompileTimeMachine<'tcx>>;
pub type CompileTimeInterpCx<'tcx> = InterpCx<'tcx, CompileTimeMachine<'tcx>>;
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum MemoryKind {