From: bors Date: Fri, 10 Apr 2015 23:49:24 +0000 (+0000) Subject: Auto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brson X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=93f7fe32d30b67baa6abf09c073c5862a978dc57;p=rust.git Auto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brson Use `discriminant_value` intrinsic for `derive(PartialOrd)` [breaking-change] This is a [breaking-change] because it can change the result of comparison operators when enum discriminants have been explicitly assigned. Notably in a case like: ```rust #[derive(PartialOrd)] enum E { A = 2, B = 1} ``` Under the old deriving, `A < B` held, because `A` came before `B` in the order of declaration. But now we use the ordering according to the provided values, and thus `A > B`. (However, this change is very unlikely to break much, if any, code, since the orderings themselves should all remain well-defined, total, etc.) Fix #15523 --- 93f7fe32d30b67baa6abf09c073c5862a978dc57