From 4e505a889bd671be7c4a521b8362d9555c830544 Mon Sep 17 00:00:00 2001 From: matt rice Date: Tue, 25 Aug 2026 03:22:38 -0700 Subject: [PATCH 1/2] Mark lrlex::codegen enums non_exhaustive --- lrlex/src/lib/codegen.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lrlex/src/lib/codegen.rs b/lrlex/src/lib/codegen.rs index 570745345..0b9e356e9 100644 --- a/lrlex/src/lib/codegen.rs +++ b/lrlex/src/lib/codegen.rs @@ -21,6 +21,7 @@ use std::{ static RE_TOKEN_ID: LazyLock = LazyLock::new(|| Regex::new(r"^[a-zA-Z_][a-zA-Z_0-9]*$").unwrap()); +#[non_exhaustive] pub(crate) enum LexerSrcEnvError { GrmtoolsSectionParseError(Vec>), GrmtoolsSectionMergeError(MergeError>>), @@ -229,6 +230,7 @@ where } } +#[non_exhaustive] pub(crate) enum LexerBuildEnvError {} impl fmt::Display for LexerBuildEnvError { @@ -279,6 +281,7 @@ where } } +#[non_exhaustive] pub(crate) enum LexerCodegenError { InvalidRustIdentifierModName { mod_name: String, error: syn::Error }, } From 66ba3770675ee43c46478de72ab6105cb417ccee Mon Sep 17 00:00:00 2001 From: matt rice Date: Tue, 25 Aug 2026 03:26:45 -0700 Subject: [PATCH 2/2] Mark lrpar::codegen enums non_exhaustive --- lrpar/src/lib/codegen.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lrpar/src/lib/codegen.rs b/lrpar/src/lib/codegen.rs index d36cc4874..65ddb7948 100644 --- a/lrpar/src/lib/codegen.rs +++ b/lrpar/src/lib/codegen.rs @@ -32,6 +32,7 @@ const ACTIONS_KIND: &str = "__GtActionsKind"; const ACTIONS_KIND_PREFIX: &str = "Ak"; const ACTIONS_KIND_HIDDEN: &str = "__GtActionsKindHidden"; +#[non_exhaustive] pub(crate) enum ParserSrcEnvError { GrmtoolsSectionParseError(Vec>), GrmtoolsSectionMergeError(MergeError>>), @@ -40,6 +41,7 @@ pub(crate) enum ParserSrcEnvError { MissingModName, } +#[non_exhaustive] pub(crate) enum ParserBuildEnvError where LexerTypesT: LexerTypes, @@ -51,6 +53,7 @@ where GrmtoolsSectionMissingRequiredKeys(Vec), } +#[non_exhaustive] pub(crate) enum CodegenError { ProcMacro2Error(proc_macro2::LexError), InvalidRustIdentifierModName(syn::Error, String),