Simplify get_size2 usage (#19643)

## Summary

These were added in the 0.5.0 release.
This commit is contained in:
Ibraheem Ahmed 2025-07-30 15:31:37 -04:00 committed by GitHub
parent 4739bc8d14
commit 8f8c39c435
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 61 additions and 67 deletions

View file

@ -61,7 +61,7 @@ impl ModuleResolveMode {
///
/// This query should not be called directly. Instead, use [`resolve_module`]. It only exists
/// because Salsa requires the module name to be an ingredient.
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
#[salsa::tracked(heap_size=get_size2::heap_size)]
fn resolve_module_query<'db>(
db: &'db dyn Db,
module_name: ModuleNameIngredient<'db>,
@ -118,7 +118,7 @@ pub(crate) fn path_to_module<'db>(db: &'db dyn Db, path: &FilePath) -> Option<Mo
/// Resolves the module for the file with the given id.
///
/// Returns `None` if the file is not a module locatable via any of the known search paths.
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
#[salsa::tracked(heap_size=get_size2::heap_size)]
pub(crate) fn file_to_module(db: &dyn Db, file: File) -> Option<Module<'_>> {
let _span = tracing::trace_span!("file_to_module", ?file).entered();
@ -322,7 +322,7 @@ impl SearchPaths {
/// The editable-install search paths for the first `site-packages` directory
/// should come between the two `site-packages` directories when it comes to
/// module-resolution priority.
#[salsa::tracked(returns(deref), heap_size=get_size2::GetSize::get_heap_size)]
#[salsa::tracked(returns(deref), heap_size=get_size2::heap_size)]
pub(crate) fn dynamic_resolution_paths(db: &dyn Db) -> Vec<SearchPath> {
tracing::debug!("Resolving dynamic module resolution paths");