Source context

Rust library

first

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

152     #[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]153     #[inline]154     #[must_use]155     pub const fn first(&self) -> Option<&T> {156         if let [first, ..] = self { Some(first) } else { None }157     }158 

Aeneas declaration

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

@[rust_fun "core::slice::{[@T]}::first"]
axiom core.slice.Slice.first {T : Type} : Slice T → Result (Option T)
Source details
Declarationcore.slice.Slice.first
File/rustc/library/core/src/slice/mod.rs
Lines155:4–155:43
Program versionPreparation 1