From 31218add95ce6c94234be2364e7ebbd276101ab9 Mon Sep 17 00:00:00 2001 From: Eduardo Pinho Date: Sun, 14 Jan 2018 21:23:19 +0000 Subject: [PATCH] Include note for implementers of AsPrimitive --- src/cast.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cast.rs b/src/cast.rs index 9e6974f..2d7fe19 100644 --- a/src/cast.rs +++ b/src/cast.rs @@ -454,6 +454,9 @@ impl NumCast for Wrapping { /// A generic interface for casting between machine scalars with the /// `as` operator, which admits narrowing and precision loss. +/// Implementers of this trait AsPrimitive should behave like a primitive +/// numeric type (e.g. a newtype around another primitive), and the +/// intended conversion must never fail. /// /// # Examples ///