From 34d5b5450cf8728321a77f3e32393197fd66a325 Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Sun, 14 Jun 2015 18:24:52 +0200 Subject: [PATCH] Replaced a comment mentioning a fixed issue Replaced it with a comment mentioning the rationale for checking the discriminants first. --- src/libsyntax/ext/deriving/generic/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index e5b93db4f39..e7d242ab703 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -1042,10 +1042,12 @@ fn expand_enum_method_body<'b>(&self, /// variants where all of the variants match, and one catch-all for /// when one does not match. + /// As an optimization we generate code which checks whether all variants + /// match first which makes llvm see that C-like enums can be compiled into + /// a simple equality check (for PartialEq). + /// The catch-all handler is provided access the variant index values - /// for each of the self-args, carried in precomputed variables. (Nota - /// bene: the variant index values are not necessarily the - /// discriminant values. See issue #15523.) + /// for each of the self-args, carried in precomputed variables. /// ```{.text} /// let __self0_vi = unsafe { -- 2.44.0