From 38af7b068f506019a3aaa7c107e22bc1395f7b27 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 20 Aug 2024 14:58:10 +0200 Subject: [PATCH] ctfe: make CompileTimeInterpCx type alias public --- compiler/rustc_const_eval/src/const_eval/machine.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index a075bdc191181..c3d94ca0e596b 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -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 interpret::AllocMap for FxIndexMap { } } -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 {