Skip to content

Commit

Permalink
Add unstable tag to pointer_offset and pointer_object
Browse files Browse the repository at this point in the history
  • Loading branch information
artemagvanian committed Jul 5, 2024
1 parent 057aa83 commit 71c8313
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 14 additions & 2 deletions library/kani/src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,28 @@ pub(crate) fn is_initialized<T: ?Sized>(_ptr: *const T, _len: usize) -> bool {
}

/// Get the object ID of the given pointer.
#[doc(hidden)]
#[crate::unstable(
feature = "ghost-state",
issue = 3184,
reason = "experimental ghost state/shadow memory API"
)]
#[rustc_diagnostic_item = "KaniPointerObject"]
#[inline(never)]
pub(crate) fn pointer_object<T: ?Sized>(_ptr: *const T) -> usize {
pub fn pointer_object<T: ?Sized>(_ptr: *const T) -> usize {
kani_intrinsic()
}

/// Get the object offset of the given pointer.
#[doc(hidden)]
#[crate::unstable(
feature = "ghost-state",
issue = 3184,
reason = "experimental ghost state/shadow memory API"
)]
#[rustc_diagnostic_item = "KaniPointerOffset"]
#[inline(never)]
pub(crate) fn pointer_offset<T: ?Sized>(_ptr: *const T) -> usize {
pub fn pointer_offset<T: ?Sized>(_ptr: *const T) -> usize {
kani_intrinsic()
}

Expand Down
16 changes: 14 additions & 2 deletions library/kani_core/src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,28 @@ macro_rules! kani_mem {
}

/// Get the object ID of the given pointer.
#[doc(hidden)]
#[crate::unstable(
feature = "ghost-state",
issue = 3184,
reason = "experimental ghost state/shadow memory API"
)]
#[rustc_diagnostic_item = "KaniPointerObject"]
#[inline(never)]
pub(crate) fn pointer_object<T: ?Sized>(_ptr: *const T) -> usize {
pub fn pointer_object<T: ?Sized>(_ptr: *const T) -> usize {
kani_intrinsic()
}

/// Get the object offset of the given pointer.
#[doc(hidden)]
#[crate::unstable(
feature = "ghost-state",
issue = 3184,
reason = "experimental ghost state/shadow memory API"
)]
#[rustc_diagnostic_item = "KaniPointerOffset"]
#[inline(never)]
pub(crate) fn pointer_offset<T: ?Sized>(_ptr: *const T) -> usize {
pub fn pointer_offset<T: ?Sized>(_ptr: *const T) -> usize {
kani_intrinsic()
}
};
Expand Down

0 comments on commit 71c8313

Please sign in to comment.