Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011)

This commit is contained in:
Micha Reiser 2025-06-28 20:24:00 +02:00 committed by GitHub
parent c5995c40d3
commit 29927f2b59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 210 additions and 425 deletions

View file

@ -1,9 +1,9 @@
use ruff_db::{Db as SourceDb, Upcast, files::File};
use ruff_db::{Db as SourceDb, files::File};
use crate::PyFormatOptions;
#[salsa::db]
pub trait Db: SourceDb + Upcast<dyn SourceDb> {
pub trait Db: SourceDb {
/// Returns the formatting options
fn format_options(&self, file: File) -> PyFormatOptions;
}

View file

@ -165,14 +165,14 @@ where
pub fn formatted_file(db: &dyn Db, file: File) -> Result<Option<String>, FormatModuleError> {
let options = db.format_options(file);
let parsed = parsed_module(db.upcast(), file).load(db.upcast());
let parsed = parsed_module(db, file).load(db);
if let Some(first) = parsed.errors().first() {
return Err(FormatModuleError::ParseError(first.clone()));
}
let comment_ranges = CommentRanges::from(parsed.tokens());
let source = source_text(db.upcast(), file);
let source = source_text(db, file);
let formatted = format_node(&parsed, &comment_ranges, &source, options)?;
let printed = formatted.print()?;