File tree Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ Unreleased]
9
+
10
+ ### Fixed
11
+ - Use stable methods to retrieve the discriminant in ` PartialOrd ` and ` Ord `
12
+ implementations. Safe methods are now also used with the ` safe ` crate
13
+ feature, significantly improving the performance there.
14
+
8
15
## [ 1.2.3] - 2023-08-23
9
16
10
17
### Fixed
Original file line number Diff line number Diff line change @@ -285,11 +285,12 @@ Unions only support [`Clone`] and [`Copy`].
285
285
default too. Without this feature [ ` transmute ` ] is
286
286
used to convert [ ` Discriminant ` ] to a [ ` i32 ` ] ,
287
287
which is the underlying type.
288
- - ` safe ` : Implements [ ` Ord ` ] and [ ` PartialOrd ` ] manually. This is much
289
- slower, but might be preferred if you don't trust derive-where. It also
290
- replaces all cases of [ ` core::hint::unreachable_unchecked ` ] in [ ` Ord ` ] ,
291
- [ ` PartialEq ` ] and [ ` PartialOrd ` ] , which is what std uses, with
292
- [ ` unreachable ` ] .
288
+ - ` safe ` : Implements [ ` Ord ` ] and [ ` PartialOrd ` ] on enums with a non-default
289
+ representation and at least one non-empty variant without unsafely
290
+ accessing the discriminant. This is much slower, but might be preferred if
291
+ you don't trust derive-where. It also replaces all cases of
292
+ [ ` core::hint::unreachable_unchecked ` ] in [ ` Ord ` ] , [ ` PartialEq ` ] and
293
+ [ ` PartialOrd ` ] , which is what std uses, with [ ` unreachable ` ] .
293
294
- ` zeroize ` : Allows deriving [ ` Zeroize ` ] and [ ` zeroize ` ] [ method@zeroize ] on
294
295
[ ` Drop ` ] .
295
296
- ` zeroize-on-drop ` : Allows deriving [ ` Zeroize ` ] and [ ` ZeroizeOnDrop ` ] and
Original file line number Diff line number Diff line change 324
324
//! default too. Without this feature [`transmute`](core::mem::transmute) is
325
325
//! used to convert [`Discriminant`](core::mem::Discriminant) to a [`i32`],
326
326
//! which is the underlying type.
327
- //! - `safe`: Implements [`Ord`] and [`PartialOrd`] manually. This is much
328
- //! slower, but might be preferred if you don't trust derive-where. It also
329
- //! replaces all cases of [`core::hint::unreachable_unchecked`] in [`Ord`],
330
- //! [`PartialEq`] and [`PartialOrd`], which is what std uses, with
331
- //! [`unreachable`].
327
+ //! - `safe`: Implements [`Ord`] and [`PartialOrd`] on enums with a non-default
328
+ //! representation and at least one non-empty variant without unsafely
329
+ //! accessing the discriminant. This is much slower, but might be preferred if
330
+ //! you don't trust derive-where. It also replaces all cases of
331
+ //! [`core::hint::unreachable_unchecked`] in [`Ord`], [`PartialEq`] and
332
+ //! [`PartialOrd`], which is what std uses, with [`unreachable`].
332
333
//! - `zeroize`: Allows deriving [`Zeroize`] and [`zeroize`][method@zeroize] on
333
334
//! [`Drop`].
334
335
//! - `zeroize-on-drop`: Allows deriving [`Zeroize`] and [`ZeroizeOnDrop`] and
You can’t perform that action at this time.
0 commit comments