From e1c8b64ae38c93ad42324d12a436a76e24426ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Thu, 24 Mar 2022 02:59:21 +0100 Subject: [PATCH] Add a safety section for RawBitFlags Shut up clippy --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 1e142e3..b813b7f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -188,6 +188,11 @@ pub trait BitFlag: Copy + Clone + 'static + _internal::RawBitFlags { pub mod _internal { /// A trait automatically implemented by `#[bitflags]` to make the enum /// a valid type parameter for `BitFlags`. + /// + /// # Safety + /// + /// The values should reflect reality, like they do if the implementation + /// is generated by the procmacro. pub unsafe trait RawBitFlags: Copy + Clone + 'static { /// The underlying integer type. type Numeric: BitFlagNum;