Skip to content

Commit 7330ef9

Browse files
committed
Move enum according to review comment
1 parent 4de08b7 commit 7330ef9

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/eval.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,6 @@ pub enum BacktraceStyle {
6868
Off,
6969
}
7070

71-
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
72-
pub enum ProvenanceMode {
73-
/// Int2ptr casts return pointers with "wildcard" provenance
74-
/// that basically matches that of all exposed pointers
75-
/// (and SB tags, if enabled).
76-
Permissive,
77-
/// Int2ptr casts return pointers with an invalid provenance,
78-
/// i.e., not valid for any memory access.
79-
Strict,
80-
/// Int2ptr casts determine the allocation they point to at cast time.
81-
/// All allocations are considered exposed.
82-
Legacy,
83-
}
84-
8571
/// Configuration needed to spawn a Miri instance.
8672
#[derive(Clone)]
8773
pub struct MiriConfig {

src/intptrcast.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ use rustc_target::abi::{HasDataLayout, Size};
99

1010
use crate::*;
1111

12+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
13+
pub enum ProvenanceMode {
14+
/// Int2ptr casts return pointers with "wildcard" provenance
15+
/// that basically matches that of all exposed pointers
16+
/// (and SB tags, if enabled).
17+
Permissive,
18+
/// Int2ptr casts return pointers with an invalid provenance,
19+
/// i.e., not valid for any memory access.
20+
Strict,
21+
/// Int2ptr casts determine the allocation they point to at cast time.
22+
/// All allocations are considered exposed.
23+
Legacy,
24+
}
25+
1226
pub type GlobalState = RefCell<GlobalStateInner>;
1327

1428
#[derive(Clone, Debug)]

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ pub use crate::diagnostics::{
7575
NonHaltingDiagnostic, TerminationInfo,
7676
};
7777
pub use crate::eval::{
78-
create_ecx, eval_entry, AlignmentCheck, BacktraceStyle, IsolatedOp, MiriConfig, ProvenanceMode,
78+
create_ecx, eval_entry, AlignmentCheck, BacktraceStyle, IsolatedOp, MiriConfig,
7979
RejectOpWith,
8080
};
8181
pub use crate::helpers::EvalContextExt as HelpersEvalContextExt;
82+
pub use crate::intptrcast::ProvenanceMode;
8283
pub use crate::machine::{
8384
AllocExtra, ConcreteTag, Evaluator, FrameData, MiriEvalContext, MiriEvalContextExt,
8485
MiriMemoryKind, Tag, NUM_CPUS, PAGE_SIZE, STACK_ADDR, STACK_SIZE,

0 commit comments

Comments
 (0)