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

@ -37,7 +37,7 @@
use crate::db::Db;
use ruff_db::files::File;
use ruff_db::parsed::parsed_module;
use ruff_db::source::{line_index, source_text, SourceText};
use ruff_db::source::{SourceText, line_index, source_text};
use ruff_python_trivia::{CommentRanges, Cursor};
use ruff_source_file::{LineIndex, OneIndexed};
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
@ -482,7 +482,9 @@ pub(crate) enum ErrorAssertionParseError<'a> {
MultipleRuleCodes,
#[error("expected '\"' to be the final character in an assertion with an error message")]
UnclosedMessage,
#[error("unexpected character `{character}` at offset {offset} (relative to the `:` in the assertion comment)")]
#[error(
"unexpected character `{character}` at offset {offset} (relative to the `:` in the assertion comment)"
)]
UnexpectedCharacter { character: char, offset: usize },
}
@ -681,8 +683,10 @@ mod tests {
assert_eq!(line1.line_number, OneIndexed::from_zero_indexed(2));
assert_eq!(line2.line_number, OneIndexed::from_zero_indexed(3));
let [UnparsedAssertion::Error(error1), UnparsedAssertion::Revealed(expected_ty)] =
&line1.assertions[..]
let [
UnparsedAssertion::Error(error1),
UnparsedAssertion::Revealed(expected_ty),
] = &line1.assertions[..]
else {
panic!("expected one error assertion and one Revealed assertion");
};