[][src]Function pre::core::const_pointer__impl__sub__

pub fn const_pointer__impl__sub__()

A stub for the preconditions of the core::const_pointer<T>::sub function.

What is this function?

This function was generated by an impl block inside a extern_crate attribute that looked like this:

This example is not tested
impl< T > const_pointer < T > where T : ? Sized {
    unsafe fn sub(self, count : usize) -> * const T;
    /* other items omitted */
}

Preconditions on external functions inside of an impl block are attached to empty functions like this one. When the preconditions should be checked, a call to this function is inserted, which triggers checking the preconditions.

This function has preconditions

This function has the following preconditions generated by pre attributes:

  • the starting and the resulting pointer are in bounds of the same allocated object
  • the computed offset, in bytes, does not overflow an isize
  • performing the subtraction does not result in overflow

To call the function you need to assure that the preconditions hold:

This example is not tested
#[forward(impl pre::core::const_pointer)]
#[assure(
    "the starting and the resulting pointer are in bounds of the same allocated object",
    reason = "<specify the reason why you can assure this here>"
)]
#[assure(
    "the computed offset, in bytes, does not overflow an `isize`",
    reason = "<specify the reason why you can assure this here>"
)]
#[assure(
    "performing the subtraction does not result in overflow",
    reason = "<specify the reason why you can assure this here>"
)]
x.sub(/* parameters omitted */);