diff --git a/src/ast/helpers.rs b/src/ast/helpers.rs index b872e7064c..e92993e881 100644 --- a/src/ast/helpers.rs +++ b/src/ast/helpers.rs @@ -6,7 +6,6 @@ use rustpython_ast::{Excepthandler, ExcepthandlerKind, Expr, ExprKind, Location, use crate::ast::types::Range; use crate::SourceCodeLocator; -#[inline(always)] fn collect_call_path_inner<'a>(expr: &'a Expr, parts: &mut Vec<&'a str>) { match &expr.node { ExprKind::Call { func, .. } => { @@ -24,7 +23,7 @@ fn collect_call_path_inner<'a>(expr: &'a Expr, parts: &mut Vec<&'a str>) { } /// Convert an `Expr` to its call path (like `List`, or `typing.List`). -#[inline(always)] + pub fn compose_call_path(expr: &Expr) -> Option { let segments = collect_call_paths(expr); if segments.is_empty() { @@ -35,7 +34,7 @@ pub fn compose_call_path(expr: &Expr) -> Option { } /// Convert an `Expr` to its call path segments (like ["typing", "List"]). -#[inline(always)] + pub fn collect_call_paths(expr: &Expr) -> Vec<&str> { let mut segments = vec![]; collect_call_path_inner(expr, &mut segments); diff --git a/src/ast/visitor.rs b/src/ast/visitor.rs index ae73e30e82..8c1044fe96 100644 --- a/src/ast/visitor.rs +++ b/src/ast/visitor.rs @@ -577,7 +577,7 @@ pub fn walk_pattern<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, pattern: &'a P } #[allow(unused_variables)] -#[inline(always)] + pub fn walk_expr_context<'a, V: Visitor<'a> + ?Sized>( visitor: &mut V, expr_context: &'a ExprContext, @@ -585,21 +585,21 @@ pub fn walk_expr_context<'a, V: Visitor<'a> + ?Sized>( } #[allow(unused_variables)] -#[inline(always)] + pub fn walk_boolop<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, boolop: &'a Boolop) {} #[allow(unused_variables)] -#[inline(always)] + pub fn walk_operator<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, operator: &'a Operator) {} #[allow(unused_variables)] -#[inline(always)] + pub fn walk_unaryop<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, unaryop: &'a Unaryop) {} #[allow(unused_variables)] -#[inline(always)] + pub fn walk_cmpop<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, cmpop: &'a Cmpop) {} #[allow(unused_variables)] -#[inline(always)] + pub fn walk_alias<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, alias: &'a Alias) {} diff --git a/src/check_ast.rs b/src/check_ast.rs index 20355792fa..79e2b6b132 100644 --- a/src/check_ast.rs +++ b/src/check_ast.rs @@ -128,7 +128,7 @@ impl<'a> Checker<'a> { } /// Add a `Check` to the `Checker`. - #[inline(always)] + pub(crate) fn add_check(&mut self, check: Check) { // If we're in an f-string, override the location. RustPython doesn't produce // reliable locations for expressions within f-strings, so we use the @@ -145,7 +145,7 @@ impl<'a> Checker<'a> { } /// Add multiple `Check` items to the `Checker`. - #[inline(always)] + pub(crate) fn add_checks(&mut self, checks: impl Iterator) { for check in checks { self.add_check(check);