Function pre::alloc::str::from_boxed_utf8_unchecked[][src]

pub unsafe fn from_boxed_utf8_unchecked(v: Box<[u8]>) -> Box<str>
Expand description

alloc_lib::str::from_boxed_utf8_unchecked with preconditions.

This function behaves exactly like alloc_lib::str::from_boxed_utf8_unchecked, but also has preconditions checked by pre.

You should also read the Safety section on the documentation of alloc_lib::str::from_boxed_utf8_unchecked.

This function has preconditions

This function has the following precondition generated by the pre attribute:

  • the content of v is valid UTF-8

To call the function you need to assure that the precondition holds:

#[assure(
    "the content of `v` is valid UTF-8",
    reason = "<specify the reason why you can assure this here>"
)]
from_boxed_utf8_unchecked(/* parameters omitted */);