Source context

Rust library

as_bytes

This is Rust standard-library source from the compiler version used in the run.

495     #[must_use]496     #[inline(always)]497     #[allow(unused_attributes)]498     pub const fn as_bytes(&self) -> &[u8] {499         // SAFETY: const sound because we transmute two types with the same layout500         unsafe { mem::transmute(self) }501     }

Aeneas declaration

Aeneas generated this declaration for a Rust library operation. Any authored model recorded for this operation is shown below.

@[rust_fun "core::str::{str}::as_bytes"]
axiom core.str.Str.as_bytes : Str → Result (Slice Std.U8)
Source details
Declarationcore.str.Str.as_bytes
File/rustc/library/core/src/str/mod.rs
Lines498:4–498:41
Program versionPreparation 1