diff --git a/src/lib.rs b/src/lib.rs index 128b338f943d..50b1305e52c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,8 +44,12 @@ use range_map::RangeMap; #[allow(unused_imports)] // FIXME rustc bug https://github.com/rust-lang/rust/issues/53682 use helpers::{ScalarExt, EvalContextExt as HelpersEvalContextExt}; use mono_hash_map::MonoHashMap; -use stacked_borrows::{EvalContextExt as StackedBorEvalContextExt, Borrow}; +use stacked_borrows::{EvalContextExt as StackedBorEvalContextExt}; +// Used by priroda +pub use stacked_borrows::{Borrow, Stacks, Mut as MutBorrow}; + +// Used by priroda pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>( tcx: TyCtxt<'a, 'tcx, 'tcx>, main_id: DefId, diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index f634f17109c7..96ae2aa5c576 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -21,12 +21,20 @@ pub enum Mut { impl Mut { #[inline(always)] - fn is_raw(self) -> bool { + pub fn is_raw(self) -> bool { match self { Mut::Raw => true, _ => false, } } + + #[inline(always)] + pub fn is_uniq(self) -> bool { + match self { + Mut::Uniq(_) => true, + _ => false, + } + } } /// Information about any kind of borrow @@ -40,9 +48,17 @@ pub enum Borrow { impl Borrow { #[inline(always)] - fn is_uniq(self) -> bool { + pub fn is_uniq(self) -> bool { match self { - Borrow::Mut(Mut::Uniq(_)) => true, + Borrow::Mut(m) => m.is_uniq(), + _ => false, + } + } + + #[inline(always)] + pub fn is_frz(self) -> bool { + match self { + Borrow::Frz(_) => true, _ => false, } }