about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-20 22:21:59 +0200
committerGitHub <noreply@github.com>2024-08-20 22:21:59 +0200
commitb1f19caa599a707cc848a1421c7560cc278cf55e (patch)
tree0f27f5c2b86176d12f2de49ea52d29df214598b5 /compiler/rustc_const_eval/src
parentef9fba22325b04ba20add146ffedc0636aaa2cb0 (diff)
parent38af7b068f506019a3aaa7c107e22bc1395f7b27 (diff)
downloadrust-b1f19caa599a707cc848a1421c7560cc278cf55e.tar.gz
rust-b1f19caa599a707cc848a1421c7560cc278cf55e.zip
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.
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/machine.rs7
1 files 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 a075bdc1911..c3d94ca0e59 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<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 {