From de703190e5482e011b0ca0267be8821ee35c357c Mon Sep 17 00:00:00 2001 From: Chris Chang <51393127+chriscerie@users.noreply.github.com> Date: Wed, 25 Oct 2023 18:34:10 -0700 Subject: [PATCH] Fix compilation errors (#564) Fixes [error](https://github.com/Kampfkarren/selene/actions/runs/6647693372/job/18063533594?pr=563) introduced by https://github.com/rust-lang/rust/pull/116734 as well as warning introduced by https://github.com/rust-lang/rust/commit/482275b19422b871b986ec0400257a9b80080218 --- selene-lib/src/ast_util/mod.rs | 1 - selene-lib/src/lints/high_cyclomatic_complexity.rs | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/selene-lib/src/ast_util/mod.rs b/selene-lib/src/ast_util/mod.rs index 7947d18e..ff7ecf4e 100644 --- a/selene-lib/src/ast_util/mod.rs +++ b/selene-lib/src/ast_util/mod.rs @@ -16,7 +16,6 @@ mod strip_parentheses; pub mod visit_nodes; pub use extract_static_token::extract_static_token; -pub use loop_tracker::LoopTracker; pub use purge_trivia::purge_trivia; pub use side_effects::HasSideEffects; pub use strip_parentheses::strip_parentheses; diff --git a/selene-lib/src/lints/high_cyclomatic_complexity.rs b/selene-lib/src/lints/high_cyclomatic_complexity.rs index d3dd36d7..cb5104d0 100644 --- a/selene-lib/src/lints/high_cyclomatic_complexity.rs +++ b/selene-lib/src/lints/high_cyclomatic_complexity.rs @@ -131,10 +131,9 @@ fn count_suffix_complexity(suffix: &ast::Suffix, starting_complexity: u16) -> u1 ast::Suffix::Index(ast::Index::Brackets { expression, .. }) => { complexity = count_expression_complexity(expression, complexity) } - #[cfg_attr( - feature = "force_exhaustive_checks", - deny(non_exhaustive_omitted_patterns) - )] + ast::Suffix::Index(ast::Index::Dot { .. }) => { + // Dot indexing doesn't contribute to complexity + } ast::Suffix::Call(call) => match call { ast::Call::AnonymousCall(arguments) => { complexity = count_arguments_complexity(arguments, complexity)