Function pre::std::mut_pointer__impl__as_mut__ [−][src]
pub fn mut_pointer__impl__as_mut__()
Expand description
A stub for the preconditions of the std::mut_pointer<T>::as_mut
function.
What is this function?
This function was generated by an impl
block inside a extern_crate
attribute that looked like this:
ⓘ
impl< T > mut_pointer < T > where T : ? Sized {
unsafe fn as_mut < 'a > (self) -> Option < & 'a mut 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 pointer
self
must have a proper alignment for its type self
is null orself
is a valid for both reads and writesself
is null orself
points to an initialized value of typeT
- the memory referenced by the returned reference is not accessed by any pointer other than the returned reference for the duration of
'a
To call the function you need to assure
that the preconditions hold:
ⓘ
#[forward(impl pre::std::mut_pointer)]
#[assure(
proper_align(self),
reason = "<specify the reason why you can assure this here>"
)]
#[assure(
"`self` is null or `self` is a valid for both reads and writes",
reason = "<specify the reason why you can assure this here>"
)]
#[assure(
"`self` is null or `self` points to an initialized value of type `T`",
reason = "<specify the reason why you can assure this here>"
)]
#[assure(
"the memory referenced by the returned reference is not accessed by any pointer other than the returned reference for the duration of `'a`",
reason = "<specify the reason why you can assure this here>"
)]
x.as_mut(/* parameters omitted */);