Switch to Rust 2024 edition (#18129)

This commit is contained in:
Micha Reiser 2025-05-16 13:25:28 +02:00 committed by GitHub
parent e67b35743a
commit 9ae698fe30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1082 changed files with 4211 additions and 3300 deletions

View file

@ -13,8 +13,8 @@ use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
use crate::error::{FStringKind, StarTupleKind, UnparenthesizedNamedExprKind};
use crate::parser::progress::ParserProgress;
use crate::parser::{helpers, FunctionKind, Parser};
use crate::string::{parse_fstring_literal_element, parse_string_literal, StringType};
use crate::parser::{FunctionKind, Parser, helpers};
use crate::string::{StringType, parse_fstring_literal_element, parse_string_literal};
use crate::token::{TokenKind, TokenValue};
use crate::token_set::TokenSet;
use crate::{

View file

@ -1,7 +1,7 @@
use ruff_python_ast::{self as ast, CmpOp, Expr, ExprContext, Number};
use ruff_text_size::{Ranged, TextRange};
use crate::{error::RelaxedDecoratorError, TokenKind};
use crate::{TokenKind, error::RelaxedDecoratorError};
/// Set the `ctx` for `Expr::Id`, `Expr::Attribute`, `Expr::Subscript`, `Expr::Starred`,
/// `Expr::Tuple` and `Expr::List`. If `expr` is either `Expr::Tuple` or `Expr::List`,
@ -58,7 +58,7 @@ pub(super) fn detect_invalid_pre_py39_decorator_node(
Expr::Name(_) => return None,
Expr::Attribute(attribute) => {
return detect_invalid_pre_py39_decorator_node(&attribute.value)
return detect_invalid_pre_py39_decorator_node(&attribute.value);
}
Expr::Call(_) => return Some((RelaxedDecoratorError::CallExpression, expr.range())),

View file

@ -2,11 +2,11 @@ use ruff_python_ast::name::Name;
use ruff_python_ast::{self as ast, Expr, ExprContext, Number, Operator, Pattern, Singleton};
use ruff_text_size::{Ranged, TextSize};
use crate::ParseErrorType;
use crate::parser::progress::ParserProgress;
use crate::parser::{recovery, Parser, RecoveryContextKind, SequenceMatchPatternParentheses};
use crate::parser::{Parser, RecoveryContextKind, SequenceMatchPatternParentheses, recovery};
use crate::token::{TokenKind, TokenValue};
use crate::token_set::TokenSet;
use crate::ParseErrorType;
use super::expression::ExpressionContext;

View file

@ -9,17 +9,17 @@ use ruff_python_ast::{
use ruff_text_size::{Ranged, TextRange, TextSize};
use crate::error::StarTupleKind;
use crate::parser::expression::{ParsedExpr, EXPR_SET};
use crate::parser::expression::{EXPR_SET, ParsedExpr};
use crate::parser::progress::ParserProgress;
use crate::parser::{
helpers, FunctionKind, Parser, RecoveryContext, RecoveryContextKind, WithItemKind,
FunctionKind, Parser, RecoveryContext, RecoveryContextKind, WithItemKind, helpers,
};
use crate::token::{TokenKind, TokenValue};
use crate::token_set::TokenSet;
use crate::{Mode, ParseErrorType, UnsupportedSyntaxErrorKind};
use super::expression::ExpressionContext;
use super::Parenthesized;
use super::expression::ExpressionContext;
/// Tokens that represent compound statements.
const COMPOUND_STMT_SET: TokenSet = TokenSet::new([

View file

@ -1,4 +1,4 @@
use crate::{parse, parse_expression, parse_module, Mode, ParseOptions};
use crate::{Mode, ParseOptions, parse, parse_expression, parse_module};
#[test]
fn test_modes() {