Back to Comprehensive Rust

Defining your own preconditions

src/unsafe-deep-dive/safety-preconditions/defining.md

latest253 B
Original Source
<!-- Copyright 2026 Google LLC SPDX-License-Identifier: CC-BY-4.0 -->

Defining your own preconditions

  • User-defined types are entitled to have their own safety preconditions
  • Include documentation so that they can later be determined and satisfied