diff --git a/src/parser/mod.rs b/src/parser/mod.rs index b4da1b7..2f9d40f 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -2,14 +2,12 @@ pub mod ast; pub mod parse { - #![allow(unused_braces)] - #![allow(unused_comparisons)] // FIXME - #![allow(clippy::collapsible_if)] - #![allow(clippy::if_same_then_else)] - #![allow(clippy::absurd_extreme_comparisons)] // FIXME - #![allow(clippy::needless_return)] - #![allow(clippy::upper_case_acronyms)] - #![allow(clippy::manual_range_patterns)] + #![expect(unused_braces)] + #![expect(clippy::if_same_then_else)] + #![expect(clippy::absurd_extreme_comparisons)] // FIXME + #![expect(clippy::needless_return)] + #![expect(clippy::upper_case_acronyms)] + #![expect(clippy::manual_range_patterns)] include!(concat!(env!("OUT_DIR"), "/parse.rs")); } diff --git a/src/parser/parse.y b/src/parser/parse.y index b58b22c..a3c3a64 100644 --- a/src/parser/parse.y +++ b/src/parser/parse.y @@ -61,7 +61,7 @@ use crate::dialect::{from_bytes, from_token, Token, TokenType}; use indexmap::IndexMap; use log::error; -#[allow(non_camel_case_types)] +#[expect(non_camel_case_types)] type sqlite3ParserError = crate::parser::ParserError; } // end %include diff --git a/third_party/lemon/lemon.c b/third_party/lemon/lemon.c index f2c729b..d81d8e8 100644 --- a/third_party/lemon/lemon.c +++ b/third_party/lemon/lemon.c @@ -4197,10 +4197,10 @@ void print_stack_union( /* Print out the definition of YYTOKENTYPE and YYMINORTYPE */ name = lemp->name ? lemp->name : "Parse"; lineno = *plineno; - fprintf(out,"#[allow(non_camel_case_types)]\n"); lineno++; + fprintf(out,"#[expect(non_camel_case_types)]\n"); lineno++; fprintf(out,"type %sTOKENTYPE<'i> = %s;\n",name, lemp->tokentype?lemp->tokentype:"()"); lineno++; - fprintf(out,"#[allow(non_camel_case_types)]\n"); lineno++; + fprintf(out,"#[expect(non_camel_case_types)]\n"); lineno++; fprintf(out,"enum YYMINORTYPE<'i> {\n"); lineno++; fprintf(out," yyinit(),\n"); lineno++; fprintf(out," yy0(%sTOKENTYPE<'i>),\n",name); lineno++; @@ -4489,7 +4489,7 @@ void ReportTable( if( lemp->tokenprefix ) prefix = lemp->tokenprefix; else prefix = ""; if( mhflag ){ - fprintf(out,"#[allow(non_camel_case_types)]\n"); lineno++; + fprintf(out,"#[expect(non_camel_case_types)]\n"); lineno++; fprintf(out,"#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]\n"); lineno++; fprintf(out,"#[repr(%s)]\n", minimum_size_type(0, lemp->nsymbol+1, 0)); lineno++; @@ -4504,11 +4504,9 @@ void ReportTable( tplt_xfer(lemp->name,in,out,&lineno); /* Generate the defines */ - fprintf(out,"#[allow(non_camel_case_types)]\n"); lineno++; fprintf(out,"pub type YYCODETYPE = %s; // unsigned\n", minimum_size_type(0, lemp->nsymbol+1, &szCodeType)); lineno++; fprintf(out,"const YYNOCODE: YYCODETYPE = %d;\n",lemp->nsymbol); lineno++; - fprintf(out,"#[allow(non_camel_case_types)]\n"); lineno++; fprintf(out,"type YYACTIONTYPE = %s; // unsigned\n", minimum_size_type(0,lemp->maxAction,&szActionType)); lineno++; if( lemp->wildcard ){ @@ -4648,7 +4646,7 @@ void ReportTable( lemp->tablesize += n*szActionType; fprintf(out,"macro_rules! YY_ACTTAB_COUNT {() => {%d}}\n", n); lineno++; fprintf(out,"#[rustfmt::skip]\n"); lineno++; - fprintf(out,"#[allow(non_upper_case_globals)]\n"); lineno++; + fprintf(out,"#[expect(non_upper_case_globals)]\n"); lineno++; fprintf(out,"static yy_action: [YYACTIONTYPE; %d] = [\n", n); lineno++; for(i=j=0; inlookaheadtab = n = acttab_lookahead_size(pActtab); lemp->tablesize += n*szCodeType; fprintf(out,"#[rustfmt::skip]\n"); lineno++; - fprintf(out,"#[allow(non_upper_case_globals)]\n"); lineno++; + fprintf(out,"#[expect(non_upper_case_globals)]\n"); lineno++; nLookAhead = lemp->nterminal + lemp->nactiontab; fprintf(out,"static yy_lookahead: [YYCODETYPE; %d] = [\n", nLookAhead); lineno++; for(i=j=0; inxstate; while( n>0 && lemp->sorted[n-1]->iTknOfst==NO_OFFSET ) n--; - fprintf(out, "#[allow(non_camel_case_types)]\n"); lineno++; + fprintf(out, "#[expect(non_camel_case_types)]\n"); lineno++; fprintf(out, "type YY_SHIFT_TYPE = %s;\n", minimum_size_type(mnTknOfst, lemp->nterminal+lemp->nactiontab, &sz)); lineno++; fprintf(out, "const YY_SHIFT_COUNT: YYACTIONTYPE = %d;\n", n-1); lineno++; fprintf(out, "//const YY_SHIFT_MIN: YY_SHIFT_TYPE = %d;\n", mnTknOfst); lineno++; fprintf(out, "//const YY_SHIFT_MAX: YY_SHIFT_TYPE = %d;\n", mxTknOfst); lineno++; fprintf(out, "#[rustfmt::skip]\n"); lineno++; - fprintf(out, "#[allow(non_upper_case_globals)]\n"); lineno++; + fprintf(out, "#[expect(non_upper_case_globals)]\n"); lineno++; fprintf(out, "static yy_shift_ofst: [YY_SHIFT_TYPE; %d] = [\n", n); lineno++; lemp->tablesize += n*sz; for(i=j=0; inxstate; @@ -4739,7 +4737,7 @@ void ReportTable( fprintf(out, "//const YY_REDUCE_MIN: YY_REDUCE_TYPE = %d;\n", mnNtOfst); lineno++; fprintf(out, "//const YY_REDUCE_MAX: YY_REDUCE_TYPE = %d;\n", mxNtOfst); lineno++; fprintf(out, "#[rustfmt::skip]\n"); lineno++; - fprintf(out, "#[allow(non_upper_case_globals)]\n"); lineno++; + fprintf(out, "#[expect(non_upper_case_globals)]\n"); lineno++; fprintf(out, "static yy_reduce_ofst: [YY_REDUCE_TYPE; %d] = [\n", n); lineno++; lemp->tablesize += n*sz; for(i=j=0; inxstate; fprintf(out, "#[rustfmt::skip]\n"); lineno++; - fprintf(out, "#[allow(non_upper_case_globals)]\n"); lineno++; + fprintf(out, "#[expect(non_upper_case_globals)]\n"); lineno++; fprintf(out, "static yy_default: [YYACTIONTYPE; %d] = [\n", n); lineno++; lemp->tablesize += n*szActionType; for(i=j=0; ihas_fallback ){ int mx = lemp->nterminal - 1; /* 2019-08-28: Generate fallback entries for every token to avoid @@ -4818,7 +4816,7 @@ void ReportTable( /* Generate a table containing the symbolic name of every symbol */ fprintf(out, "#[rustfmt::skip]\n"); lineno++; - fprintf(out, "#[allow(non_upper_case_globals)]\n"); lineno++; + fprintf(out, "#[expect(non_upper_case_globals)]\n"); lineno++; fprintf(out, "static yyTokenName: [&str; %d] = [\n", lemp->nsymbol); lineno++; for(i=0; insymbol; i++){ fprintf(out," /* %4d */ \"%s\",\n",i, lemp->symbols[i]->name); lineno++; @@ -4966,7 +4964,7 @@ void ReportHeader(struct lemon *lemp) out = file_open(lemp,".h","wb"); if( out ){ fprintf(out,"#[non_exhaustive]\n"); - fprintf(out,"#[allow(non_camel_case_types)]\n"); + fprintf(out,"#[expect(non_camel_case_types)]\n"); fprintf(out,"#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]\n"); fprintf(out,"#[repr(%s)]\n", minimum_size_type(0, lemp->nsymbol+1, 0)); diff --git a/third_party/lemon/lempar.rs b/third_party/lemon/lempar.rs index 614bd62..8a0bef7 100644 --- a/third_party/lemon/lempar.rs +++ b/third_party/lemon/lempar.rs @@ -164,7 +164,7 @@ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -#[allow(non_camel_case_types)] +#[expect(non_camel_case_types)] #[derive(Default)] pub struct yyStackEntry<'i> { stateno: YYACTIONTYPE, /* The state-number, or reduce action in SHIFTREDUCE */ @@ -176,7 +176,7 @@ pub struct yyStackEntry<'i> { /* The state of the parser is completely contained in an instance of ** the following structure */ -#[allow(non_camel_case_types)] +#[expect(non_camel_case_types)] pub struct yyParser<'input> { yyidx: usize, /* Index to top element of the stack */ #[cfg(feature = "YYTRACKMAXSTACKDEPTH")] @@ -251,7 +251,7 @@ static TARGET: &str = "Parse"; */ #[cfg(not(feature = "NDEBUG"))] #[rustfmt::skip] -#[allow(non_upper_case_globals)] +#[expect(non_upper_case_globals)] static yyRuleName: [&str; YYNRULE] = [ %% ]; @@ -318,7 +318,7 @@ impl yyParser<'_> { ** Clear all secondary memory allocations from the parser */ impl yyParser<'_> { - #[allow(non_snake_case)] + #[expect(non_snake_case)] pub fn ParseFinalize(&mut self) { while self.yyidx > 0 { self.yy_pop_parser_stack(); @@ -332,7 +332,7 @@ impl yyParser<'_> { */ #[cfg(feature = "YYTRACKMAXSTACKDEPTH")] impl yyParser<'_> { - #[allow(non_snake_case)] + #[expect(non_snake_case)] pub fn ParseStackPeak(&self) -> usize { self.yyhwm } @@ -388,7 +388,7 @@ fn ParseCoverage(/*FILE *out*/) -> i32 { ** Find the appropriate action for a parser given the terminal ** look-ahead token iLookAhead. */ -#[allow(non_snake_case)] +#[expect(non_snake_case)] fn yy_find_shift_action( mut iLookAhead: YYCODETYPE, /* The look-ahead token */ stateno: YYACTIONTYPE, /* Current state number */ @@ -452,7 +452,7 @@ fn yy_find_shift_action( ** Find the appropriate action for a parser given the non-terminal ** look-ahead token iLookAhead. */ -#[allow(non_snake_case)] +#[expect(non_snake_case)] fn yy_find_reduce_action( stateno: YYACTIONTYPE, /* Current state number */ iLookAhead: YYCODETYPE, /* The look-ahead token */ @@ -486,11 +486,11 @@ fn yy_find_reduce_action( ** Print tracing information for a SHIFT action */ impl yyParser<'_> { - #[allow(non_snake_case)] + #[expect(non_snake_case)] #[cfg(feature = "NDEBUG")] fn yyTraceShift(&self, _: YYACTIONTYPE, _: &str) { } - #[allow(non_snake_case)] + #[expect(non_snake_case)] #[cfg(not(feature = "NDEBUG"))] fn yyTraceShift(&self, yyNewState: YYACTIONTYPE, zTag: &str) { let yytos = &self[0]; @@ -515,7 +515,7 @@ impl yyParser<'_> { ** Perform a shift action. */ impl<'input> yyParser<'input> { - #[allow(non_snake_case)] + #[expect(non_snake_case)] fn yy_shift( &mut self, mut yyNewState: YYACTIONTYPE, /* The new state to shift in */ @@ -542,14 +542,14 @@ impl<'input> yyParser<'input> { /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ -#[allow(non_upper_case_globals)] +#[expect(non_upper_case_globals)] static yyRuleInfoLhs: [YYCODETYPE; YYNRULE] = [ %% ]; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number ** of symbols on the right-hand side of that rule. */ -#[allow(non_upper_case_globals)] +#[expect(non_upper_case_globals)] static yyRuleInfoNRhs: [i8; YYNRULE] = [ %% ]; @@ -689,7 +689,7 @@ impl yyParser<'_> { ** None. */ impl<'input> yyParser<'input> { - #[allow(non_snake_case)] + #[expect(non_snake_case)] pub fn Parse( &mut self, yymajor: TokenType, /* The major token code number */