You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the derived partial_cmp the comparisons stops when inner partial_cmp returns None. The implementation for lt, le, gt, ge are also provided, but they
continue the comparisons instead as if compared values were considered equal.
This behaviour is also inconsistent with the implementation for tuples / slices:
#[derive(PartialEq,PartialOrd)]structP(f64,f64);fnmain(){let a = (f64::NAN,0.0);let b = (f64::NAN,1.0);// Tuples:assert_eq!(PartialOrd::partial_cmp(&a, &b), None);assert!(!(a < b));// Arrays:let a = [f64::NAN,0.0];let b = [f64::NAN,1.0];assert_eq!(PartialOrd::partial_cmp(&a, &b), None);assert!(!(a < b));// Derived:let a = P(f64::NAN,0.0);let b = P(f64::NAN,1.0);assert_eq!(PartialOrd::partial_cmp(&a, &b), None);assert!(!(a < b));// fails}
The text was updated successfully, but these errors were encountered:
jonas-schievink
added
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Jan 25, 2021
In the derived
partial_cmp
the comparisons stops when innerpartial_cmp
returnsNone
. The implementation forlt
,le
,gt
,ge
are also provided, but theycontinue the comparisons instead as if compared values were considered equal.
This behaviour is also inconsistent with the implementation for tuples / slices:
The text was updated successfully, but these errors were encountered: