From 70fc69b91609ebf236fb1fd646c2563db6369089 Mon Sep 17 00:00:00 2001 From: Yuji Sugiura <6259812+leaysgur@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:04:42 +0900 Subject: [PATCH] fix(semantic): Add Eq to CtxFlags (#3651) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've just created example using `oxc_semantic`. > https://gist.github.com/leaysgur/bcb748daa665d1615eabda6967366d05 But it could not be compiled due to: ``` error: to use a constant of type `CtxFlags` in a pattern, `CtxFlags` must be annotated with `#[derive(PartialEq, Eq)]` ``` - 0.14.0: 🆖 - ... - 0.13.0: 🆖 - 0.12.5: 🆗 This change seems to fix this. --- crates/oxc_semantic/src/control_flow/builder/context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_semantic/src/control_flow/builder/context.rs b/crates/oxc_semantic/src/control_flow/builder/context.rs index a63d1b781741..ff54a935b60e 100644 --- a/crates/oxc_semantic/src/control_flow/builder/context.rs +++ b/crates/oxc_semantic/src/control_flow/builder/context.rs @@ -3,7 +3,7 @@ use crate::{BasicBlockId, EdgeType}; use super::ControlFlowGraphBuilder; bitflags::bitflags! { - #[derive(Debug, Clone, Copy, PartialEq)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct CtxFlags: u8 { /// Anything above a `FUNCTION` is unreachable. const FUNCTION = 1;