diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index f80185ba99d82..63e63f304d213 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -10,9 +10,11 @@ use crate::interpret::{intern_const_alloc_recursive, ConstValue, InterpCx}; mod error; mod eval_queries; +mod machine; pub use error::*; pub use eval_queries::*; +pub use machine::*; /// Extracts a field of a (variant of a) const. // this function uses `unwrap` copiously, because an already validated constant must have valid diff --git a/src/librustc_mir/const_eval/eval_queries.rs b/src/librustc_mir/const_eval/eval_queries.rs index 6b0635f1c76c5..62ec4bbaec769 100644 --- a/src/librustc_mir/const_eval/eval_queries.rs +++ b/src/librustc_mir/const_eval/eval_queries.rs @@ -1,4 +1,4 @@ -use super::{error_to_const_error, CompileTimeEvalContext, CompileTimeInterpreter}; +use super::{error_to_const_error, CompileTimeEvalContext, CompileTimeInterpreter, MemoryExtra}; use crate::interpret::eval_nullary_intrinsic; use crate::interpret::{ intern_const_alloc_recursive, Allocation, ConstValue, GlobalId, ImmTy, Immediate, InterpCx, diff --git a/src/librustc_mir/const_eval/machine.rs b/src/librustc_mir/const_eval/machine.rs index 0cb654b30ccb6..a76153c19ec67 100644 --- a/src/librustc_mir/const_eval/machine.rs +++ b/src/librustc_mir/const_eval/machine.rs @@ -80,11 +80,11 @@ pub struct CompileTimeInterpreter<'mir, 'tcx> { #[derive(Copy, Clone, Debug)] pub struct MemoryExtra { /// Whether this machine may read from statics - can_access_statics: bool, + pub(super) can_access_statics: bool, } impl<'mir, 'tcx> CompileTimeInterpreter<'mir, 'tcx> { - fn new() -> Self { + pub(super) fn new() -> Self { CompileTimeInterpreter { loop_detector: Default::default(), steps_since_detector_enabled: -STEPS_UNTIL_DETECTOR_ENABLED,