Skip to content

Commit a34b9c7

Browse files
committed
make some things public for the benefit of priroda
1 parent 356369d commit a34b9c7

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ use range_map::RangeMap;
4444
#[allow(unused_imports)] // FIXME rustc bug https://github.com/rust-lang/rust/issues/53682
4545
use helpers::{ScalarExt, EvalContextExt as HelpersEvalContextExt};
4646
use mono_hash_map::MonoHashMap;
47-
use stacked_borrows::{EvalContextExt as StackedBorEvalContextExt, Borrow};
47+
use stacked_borrows::{EvalContextExt as StackedBorEvalContextExt};
4848

49+
// Used by priroda
50+
pub use stacked_borrows::{Borrow, Stacks, Mut as MutBorrow};
51+
52+
// Used by priroda
4953
pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
5054
tcx: TyCtxt<'a, 'tcx, 'tcx>,
5155
main_id: DefId,

src/stacked_borrows.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ pub enum Mut {
2121

2222
impl Mut {
2323
#[inline(always)]
24-
fn is_raw(self) -> bool {
24+
pub fn is_raw(self) -> bool {
2525
match self {
2626
Mut::Raw => true,
2727
_ => false,
2828
}
2929
}
30+
31+
#[inline(always)]
32+
pub fn is_uniq(self) -> bool {
33+
match self {
34+
Mut::Uniq(_) => true,
35+
_ => false,
36+
}
37+
}
3038
}
3139

3240
/// Information about any kind of borrow
@@ -40,9 +48,17 @@ pub enum Borrow {
4048

4149
impl Borrow {
4250
#[inline(always)]
43-
fn is_uniq(self) -> bool {
51+
pub fn is_uniq(self) -> bool {
52+
match self {
53+
Borrow::Mut(m) => m.is_uniq(),
54+
_ => false,
55+
}
56+
}
57+
58+
#[inline(always)]
59+
pub fn is_frz(self) -> bool {
4460
match self {
45-
Borrow::Mut(Mut::Uniq(_)) => true,
61+
Borrow::Frz(_) => true,
4662
_ => false,
4763
}
4864
}

0 commit comments

Comments
 (0)