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

@ -76,7 +76,7 @@ impl ModulePath {
| SearchPathInner::FirstParty(search_path)
| SearchPathInner::SitePackages(search_path)
| SearchPathInner::Editable(search_path) => {
system_path_to_file(resolver.db.upcast(), search_path.join(relative_path))
system_path_to_file(resolver.db, search_path.join(relative_path))
== Err(FileError::IsADirectory)
}
SearchPathInner::StandardLibraryCustom(stdlib_root) => {
@ -84,7 +84,7 @@ impl ModulePath {
TypeshedVersionsQueryResult::DoesNotExist => false,
TypeshedVersionsQueryResult::Exists
| TypeshedVersionsQueryResult::MaybeExists => {
system_path_to_file(resolver.db.upcast(), stdlib_root.join(relative_path))
system_path_to_file(resolver.db, stdlib_root.join(relative_path))
== Err(FileError::IsADirectory)
}
}
@ -115,16 +115,15 @@ impl ModulePath {
| SearchPathInner::Editable(search_path) => {
let absolute_path = search_path.join(relative_path);
system_path_to_file(resolver.db.upcast(), absolute_path.join("__init__.py")).is_ok()
|| system_path_to_file(resolver.db.upcast(), absolute_path.join("__init__.pyi"))
.is_ok()
system_path_to_file(resolver.db, absolute_path.join("__init__.py")).is_ok()
|| system_path_to_file(resolver.db, absolute_path.join("__init__.pyi")).is_ok()
}
SearchPathInner::StandardLibraryCustom(search_path) => {
match query_stdlib_version(relative_path, resolver) {
TypeshedVersionsQueryResult::DoesNotExist => false,
TypeshedVersionsQueryResult::Exists
| TypeshedVersionsQueryResult::MaybeExists => system_path_to_file(
resolver.db.upcast(),
resolver.db,
search_path.join(relative_path).join("__init__.pyi"),
)
.is_ok(),
@ -161,7 +160,7 @@ impl ModulePath {
#[must_use]
pub(super) fn to_file(&self, resolver: &ResolverContext) -> Option<File> {
let db = resolver.db.upcast();
let db = resolver.db;
let ModulePath {
search_path,
relative_path,

View file

@ -73,7 +73,7 @@ pub(crate) fn path_to_module(db: &dyn Db, path: &FilePath) -> Option<Module> {
// all arguments are Salsa ingredients (something stored in Salsa). `Path`s aren't salsa ingredients but
// `VfsFile` is. So what we do here is to retrieve the `path`'s `VfsFile` so that we can make
// use of Salsa's caching and invalidation.
let file = path.to_file(db.upcast())?;
let file = path.to_file(db)?;
file_to_module(db, file)
}
@ -99,7 +99,7 @@ impl std::fmt::Display for SystemOrVendoredPathRef<'_> {
pub(crate) fn file_to_module(db: &dyn Db, file: File) -> Option<Module> {
let _span = tracing::trace_span!("file_to_module", ?file).entered();
let path = match file.path(db.upcast()) {
let path = match file.path(db) {
FilePath::System(system) => SystemOrVendoredPathRef::System(system),
FilePath::Vendored(vendored) => SystemOrVendoredPathRef::Vendored(vendored),
FilePath::SystemVirtual(_) => return None,
@ -260,7 +260,7 @@ impl SearchPaths {
for path in self.static_paths.iter().chain(self.site_packages.iter()) {
if let Some(system_path) = path.as_system_path() {
if !path.is_first_party() {
files.try_add_root(db.upcast(), system_path, FileRootKind::LibrarySearchPath);
files.try_add_root(db, system_path, FileRootKind::LibrarySearchPath);
}
}
}
@ -332,7 +332,7 @@ pub(crate) fn dynamic_resolution_paths(db: &dyn Db) -> Vec<SearchPath> {
}
let site_packages_root = files
.root(db.upcast(), site_packages_dir)
.root(db, site_packages_dir)
.expect("Site-package root to have been created");
// This query needs to be re-executed each time a `.pth` file
@ -340,7 +340,7 @@ pub(crate) fn dynamic_resolution_paths(db: &dyn Db) -> Vec<SearchPath> {
// However, we don't use Salsa queries to read the source text of `.pth` files;
// we use the APIs on the `System` trait directly. As such, add a dependency on the
// site-package directory's revision.
site_packages_root.revision(db.upcast());
site_packages_root.revision(db);
dynamic_paths.push(site_packages_search_path.clone());