Skip to content

Commit 1fce886

Browse files
committed
Make some things public that are required by priroda
1 parent b6d0597 commit 1fce886

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

miri/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ pub fn eval_main<'a, 'tcx: 'a>(
146146
}
147147
}
148148

149-
struct Evaluator;
149+
pub struct Evaluator;
150150
#[derive(Default)]
151-
struct EvaluatorData {
151+
pub struct EvaluatorData {
152152
/// Environment variables set by `setenv`
153153
/// Miri does not expose env vars from the host to the emulated program
154154
pub(crate) env_vars: HashMap<Vec<u8>, MemoryPointer>,
@@ -163,7 +163,7 @@ pub struct TlsEntry<'tcx> {
163163
}
164164

165165
#[derive(Default)]
166-
struct MemoryData<'tcx> {
166+
pub struct MemoryData<'tcx> {
167167
/// The Key to use for the next thread-local allocation.
168168
next_thread_local: TlsKey,
169169

src/librustc_mir/interpret/memory.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl LockInfo {
7979
pub struct AllocId(u64);
8080

8181
#[derive(Debug)]
82-
enum AllocIdKind {
82+
pub enum AllocIdKind {
8383
/// We can't ever have more than `usize::max_value` functions at the same time
8484
/// since we never "deallocate" functions
8585
Function(usize),
@@ -89,7 +89,7 @@ enum AllocIdKind {
8989
}
9090

9191
impl AllocIdKind {
92-
fn into_alloc_id(self) -> AllocId {
92+
pub fn into_alloc_id(self) -> AllocId {
9393
match self {
9494
AllocIdKind::Function(n) => AllocId(n as u64),
9595
AllocIdKind::Runtime(n) => AllocId((1 << 63) | n),
@@ -103,10 +103,10 @@ impl AllocId {
103103
self.0 >> 63
104104
}
105105
/// Yields everything but the discriminant bits
106-
fn index(self) -> u64 {
106+
pub fn index(self) -> u64 {
107107
self.0 & ((1 << 63) - 1)
108108
}
109-
fn into_alloc_id_kind(self) -> AllocIdKind {
109+
pub fn into_alloc_id_kind(self) -> AllocIdKind {
110110
match self.discriminant() {
111111
0 => AllocIdKind::Function(self.index() as usize),
112112
1 => AllocIdKind::Runtime(self.index()),

src/librustc_mir/interpret/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub use self::eval_context::{EvalContext, Frame, ResourceLimits, StackPopCleanup
2727

2828
pub use self::lvalue::{Lvalue, LvalueExtra, GlobalId};
2929

30-
pub use self::memory::{AllocId, Memory, MemoryPointer, MemoryKind, HasMemory};
30+
pub use self::memory::{AllocId, Memory, MemoryPointer, MemoryKind, HasMemory, AllocIdKind};
3131

3232
use self::memory::{PointerArithmetic, Lock, AccessKind};
3333

0 commit comments

Comments
 (0)