From 1bf5d4ac1377f33a8e74f7738afa9e63ffe64420 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Mon, 24 Jun 2024 10:48:23 -0700 Subject: [PATCH] [error] Document validation order (#1456) Makes progress on #1331 --- src/error.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/error.rs b/src/error.rs index fff9e4d36e..e32f9eb92c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,3 +1,12 @@ +// Copyright 2024 The Fuchsia Authors +// +// Licensed under the 2-Clause BSD License , Apache License, Version 2.0 +// , or the MIT +// license , at your option. +// This file may not be copied, modified, or distributed except according to +// those terms. + //! Types related to error reporting. //! //! ## Single failure mode errors @@ -22,6 +31,12 @@ //! //! All error types provide an `into_src` method that converts the error into //! the source value underlying the failed conversion. +//! +//! ## Validation order +//! +//! Our conversion methods typically check alignment, then size, then bit +//! validity. However, we do not guarantee that this is always the case, and +//! this behavior may change between releases. use core::{convert::Infallible, fmt, marker::PhantomData, ops::Deref};