2019-03-18 07:30:57 -05:00
|
|
|
#![feature(rustc_private)]
|
2020-02-16 16:51:02 -06:00
|
|
|
#![feature(map_first_last)]
|
2021-03-08 09:57:09 -06:00
|
|
|
#![feature(map_try_insert)]
|
2020-03-12 14:46:58 -05:00
|
|
|
#![feature(never_type)]
|
2020-09-07 15:09:34 -05:00
|
|
|
#![feature(try_blocks)]
|
2021-04-15 16:19:23 -05:00
|
|
|
#![feature(bool_to_option)]
|
2019-07-24 09:24:26 -05:00
|
|
|
#![warn(rust_2018_idioms)]
|
2018-11-25 08:44:28 -06:00
|
|
|
#![allow(clippy::cast_lossless)]
|
2018-07-10 10:32:38 -05:00
|
|
|
|
2019-06-08 17:19:05 -05:00
|
|
|
extern crate rustc_apfloat;
|
2020-03-01 03:22:13 -06:00
|
|
|
extern crate rustc_ast;
|
2021-05-16 04:28:01 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rustc_middle;
|
2021-09-09 04:36:39 -05:00
|
|
|
extern crate rustc_const_eval;
|
2017-12-14 04:03:55 -06:00
|
|
|
extern crate rustc_data_structures;
|
2020-03-01 03:26:24 -06:00
|
|
|
extern crate rustc_hir;
|
2020-03-16 18:48:44 -05:00
|
|
|
extern crate rustc_index;
|
2021-04-15 16:19:23 -05:00
|
|
|
extern crate rustc_session;
|
2020-03-01 03:26:24 -06:00
|
|
|
extern crate rustc_span;
|
2018-05-01 11:13:22 -05:00
|
|
|
extern crate rustc_target;
|
2017-07-21 10:25:30 -05:00
|
|
|
|
2020-11-01 18:23:27 -06:00
|
|
|
mod data_race;
|
2019-12-23 17:11:40 -06:00
|
|
|
mod diagnostics;
|
2019-12-23 05:56:23 -06:00
|
|
|
mod eval;
|
2019-02-15 19:29:38 -06:00
|
|
|
mod helpers;
|
2019-06-20 14:21:47 -05:00
|
|
|
mod intptrcast;
|
2019-06-27 16:59:00 -05:00
|
|
|
mod machine;
|
2019-12-23 05:56:23 -06:00
|
|
|
mod mono_hash_map;
|
|
|
|
mod operator;
|
|
|
|
mod range_map;
|
|
|
|
mod shims;
|
|
|
|
mod stacked_borrows;
|
2020-04-21 18:38:14 -05:00
|
|
|
mod sync;
|
2020-04-16 15:52:14 -05:00
|
|
|
mod thread;
|
2020-11-04 21:54:39 -06:00
|
|
|
mod vector_clock;
|
2019-02-15 19:29:38 -06:00
|
|
|
|
2020-06-27 06:19:35 -05:00
|
|
|
// Establish a "crate-wide prelude": we often import `crate::*`.
|
|
|
|
|
2019-06-27 16:59:00 -05:00
|
|
|
// Make all those symbols available in the same place as our own.
|
2021-09-09 04:36:39 -05:00
|
|
|
pub use rustc_const_eval::interpret::*;
|
2019-02-15 19:29:38 -06:00
|
|
|
// Resolve ambiguity.
|
2021-09-09 04:36:39 -05:00
|
|
|
pub use rustc_const_eval::interpret::{self, AllocMap, PlaceTy};
|
2017-07-21 10:25:30 -05:00
|
|
|
|
2020-06-27 05:36:20 -05:00
|
|
|
pub use crate::shims::dlsym::{Dlsym, EvalContextExt as _};
|
|
|
|
pub use crate::shims::env::{EnvVars, EvalContextExt as _};
|
|
|
|
pub use crate::shims::foreign_items::EvalContextExt as _;
|
|
|
|
pub use crate::shims::intrinsics::EvalContextExt as _;
|
|
|
|
pub use crate::shims::os_str::EvalContextExt as _;
|
2020-06-27 06:19:35 -05:00
|
|
|
pub use crate::shims::panic::{CatchUnwindData, EvalContextExt as _};
|
2021-05-16 04:28:01 -05:00
|
|
|
pub use crate::shims::time::EvalContextExt as _;
|
2020-06-27 05:36:20 -05:00
|
|
|
pub use crate::shims::tls::{EvalContextExt as _, TlsData};
|
|
|
|
pub use crate::shims::EvalContextExt as _;
|
2019-11-29 03:16:03 -06:00
|
|
|
|
2020-11-01 18:23:27 -06:00
|
|
|
pub use crate::data_race::{
|
2021-05-16 04:28:01 -05:00
|
|
|
AtomicFenceOp, AtomicReadOp, AtomicRwOp, AtomicWriteOp,
|
|
|
|
EvalContextExt as DataRaceEvalContextExt,
|
2020-11-01 18:23:27 -06:00
|
|
|
};
|
2019-12-23 19:04:07 -06:00
|
|
|
pub use crate::diagnostics::{
|
2020-03-22 13:48:59 -05:00
|
|
|
register_diagnostic, report_error, EvalContextExt as DiagnosticsEvalContextExt,
|
2021-05-16 04:28:01 -05:00
|
|
|
NonHaltingDiagnostic, TerminationInfo,
|
2019-12-23 19:04:07 -06:00
|
|
|
};
|
2021-05-14 01:40:07 -05:00
|
|
|
pub use crate::eval::{
|
2022-02-20 10:55:39 -06:00
|
|
|
create_ecx, eval_entry, AlignmentCheck, BacktraceStyle, IsolatedOp, MiriConfig, RejectOpWith,
|
2021-05-14 01:40:07 -05:00
|
|
|
};
|
2019-12-23 05:56:23 -06:00
|
|
|
pub use crate::helpers::EvalContextExt as HelpersEvalContextExt;
|
|
|
|
pub use crate::machine::{
|
2020-04-05 16:03:44 -05:00
|
|
|
AllocExtra, Evaluator, FrameData, MemoryExtra, MiriEvalContext, MiriEvalContextExt,
|
2021-07-15 13:33:08 -05:00
|
|
|
MiriMemoryKind, Tag, NUM_CPUS, PAGE_SIZE, STACK_ADDR, STACK_SIZE,
|
2019-12-23 05:56:23 -06:00
|
|
|
};
|
|
|
|
pub use crate::mono_hash_map::MonoHashMap;
|
2018-11-27 07:41:53 -06:00
|
|
|
pub use crate::operator::EvalContextExt as OperatorEvalContextExt;
|
2019-06-27 16:59:00 -05:00
|
|
|
pub use crate::range_map::RangeMap;
|
2019-11-28 03:36:37 -06:00
|
|
|
pub use crate::stacked_borrows::{
|
2021-07-15 13:33:08 -05:00
|
|
|
CallId, EvalContextExt as StackedBorEvalContextExt, Item, Permission, PtrId, SbTag, Stack,
|
|
|
|
Stacks,
|
2019-06-29 07:37:41 -05:00
|
|
|
};
|
2021-05-16 04:28:01 -05:00
|
|
|
pub use crate::sync::{CondvarId, EvalContextExt as SyncEvalContextExt, MutexId, RwLockId};
|
2020-04-16 15:52:14 -05:00
|
|
|
pub use crate::thread::{
|
2020-04-16 21:40:02 -05:00
|
|
|
EvalContextExt as ThreadsEvalContextExt, SchedulingAction, ThreadId, ThreadManager, ThreadState,
|
2020-04-16 14:22:30 -05:00
|
|
|
};
|
2021-05-16 04:28:01 -05:00
|
|
|
pub use crate::vector_clock::{VClock, VTimestamp, VectorIdx};
|
2018-10-24 04:39:31 -05:00
|
|
|
|
2019-02-15 19:29:38 -06:00
|
|
|
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
|
2018-10-24 10:16:41 -05:00
|
|
|
/// set per default, for maximal validation power.
|
2020-10-24 14:46:02 -05:00
|
|
|
pub const MIRI_DEFAULT_ARGS: &[&str] = &[
|
|
|
|
"-Zalways-encode-mir",
|
|
|
|
"-Zmir-emit-retag",
|
|
|
|
"-Zmir-opt-level=0",
|
|
|
|
"--cfg=miri",
|
|
|
|
"-Cdebug-assertions=on",
|
|
|
|
];
|