mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Simplify get_size2
usage (#19643)
## Summary These were added in the 0.5.0 release.
This commit is contained in:
parent
4739bc8d14
commit
8f8c39c435
18 changed files with 61 additions and 67 deletions
|
@ -21,7 +21,7 @@ use crate::source::source_text;
|
||||||
/// reflected in the changed AST offsets.
|
/// reflected in the changed AST offsets.
|
||||||
/// The other reason is that Ruff's AST doesn't implement `Eq` which Salsa requires
|
/// The other reason is that Ruff's AST doesn't implement `Eq` which Salsa requires
|
||||||
/// for determining if a query result is unchanged.
|
/// for determining if a query result is unchanged.
|
||||||
#[salsa::tracked(returns(ref), no_eq, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), no_eq, heap_size=get_size2::heap_size)]
|
||||||
pub fn parsed_module(db: &dyn Db, file: File) -> ParsedModule {
|
pub fn parsed_module(db: &dyn Db, file: File) -> ParsedModule {
|
||||||
let _span = tracing::trace_span!("parsed_module", ?file).entered();
|
let _span = tracing::trace_span!("parsed_module", ?file).entered();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::Db;
|
||||||
use crate::files::{File, FilePath};
|
use crate::files::{File, FilePath};
|
||||||
|
|
||||||
/// Reads the source text of a python text file (must be valid UTF8) or notebook.
|
/// Reads the source text of a python text file (must be valid UTF8) or notebook.
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
pub fn source_text(db: &dyn Db, file: File) -> SourceText {
|
pub fn source_text(db: &dyn Db, file: File) -> SourceText {
|
||||||
let path = file.path(db);
|
let path = file.path(db);
|
||||||
let _span = tracing::trace_span!("source_text", file = %path).entered();
|
let _span = tracing::trace_span!("source_text", file = %path).entered();
|
||||||
|
@ -69,21 +69,21 @@ impl SourceText {
|
||||||
pub fn as_str(&self) -> &str {
|
pub fn as_str(&self) -> &str {
|
||||||
match &self.inner.kind {
|
match &self.inner.kind {
|
||||||
SourceTextKind::Text(source) => source,
|
SourceTextKind::Text(source) => source,
|
||||||
SourceTextKind::Notebook(notebook) => notebook.source_code(),
|
SourceTextKind::Notebook { notebook } => notebook.source_code(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the underlying notebook if this is a notebook file.
|
/// Returns the underlying notebook if this is a notebook file.
|
||||||
pub fn as_notebook(&self) -> Option<&Notebook> {
|
pub fn as_notebook(&self) -> Option<&Notebook> {
|
||||||
match &self.inner.kind {
|
match &self.inner.kind {
|
||||||
SourceTextKind::Notebook(notebook) => Some(notebook),
|
SourceTextKind::Notebook { notebook } => Some(notebook),
|
||||||
SourceTextKind::Text(_) => None,
|
SourceTextKind::Text(_) => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if this is a notebook source file.
|
/// Returns `true` if this is a notebook source file.
|
||||||
pub fn is_notebook(&self) -> bool {
|
pub fn is_notebook(&self) -> bool {
|
||||||
matches!(&self.inner.kind, SourceTextKind::Notebook(_))
|
matches!(&self.inner.kind, SourceTextKind::Notebook { .. })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if there was an error when reading the content of the file.
|
/// Returns `true` if there was an error when reading the content of the file.
|
||||||
|
@ -108,7 +108,7 @@ impl std::fmt::Debug for SourceText {
|
||||||
SourceTextKind::Text(text) => {
|
SourceTextKind::Text(text) => {
|
||||||
dbg.field(text);
|
dbg.field(text);
|
||||||
}
|
}
|
||||||
SourceTextKind::Notebook(notebook) => {
|
SourceTextKind::Notebook { notebook } => {
|
||||||
dbg.field(notebook);
|
dbg.field(notebook);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,23 +123,15 @@ struct SourceTextInner {
|
||||||
read_error: Option<SourceTextError>,
|
read_error: Option<SourceTextError>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, PartialEq)]
|
#[derive(Eq, PartialEq, get_size2::GetSize)]
|
||||||
enum SourceTextKind {
|
enum SourceTextKind {
|
||||||
Text(String),
|
Text(String),
|
||||||
Notebook(Box<Notebook>),
|
Notebook {
|
||||||
}
|
|
||||||
|
|
||||||
impl get_size2::GetSize for SourceTextKind {
|
|
||||||
fn get_heap_size(&self) -> usize {
|
|
||||||
match self {
|
|
||||||
SourceTextKind::Text(text) => text.get_heap_size(),
|
|
||||||
// TODO: The `get-size` derive does not support ignoring enum variants.
|
|
||||||
//
|
|
||||||
// Jupyter notebooks are not very relevant for memory profiling, and contain
|
// Jupyter notebooks are not very relevant for memory profiling, and contain
|
||||||
// arbitrary JSON values that do not implement the `GetSize` trait.
|
// arbitrary JSON values that do not implement the `GetSize` trait.
|
||||||
SourceTextKind::Notebook(_) => 0,
|
#[get_size(ignore)]
|
||||||
}
|
notebook: Box<Notebook>,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<String> for SourceTextKind {
|
impl From<String> for SourceTextKind {
|
||||||
|
@ -150,7 +142,9 @@ impl From<String> for SourceTextKind {
|
||||||
|
|
||||||
impl From<Notebook> for SourceTextKind {
|
impl From<Notebook> for SourceTextKind {
|
||||||
fn from(notebook: Notebook) -> Self {
|
fn from(notebook: Notebook) -> Self {
|
||||||
SourceTextKind::Notebook(Box::new(notebook))
|
SourceTextKind::Notebook {
|
||||||
|
notebook: Box::new(notebook),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +157,7 @@ pub enum SourceTextError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the [`LineIndex`] for `file`.
|
/// Computes the [`LineIndex`] for `file`.
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
pub fn line_index(db: &dyn Db, file: File) -> LineIndex {
|
pub fn line_index(db: &dyn Db, file: File) -> LineIndex {
|
||||||
let _span = tracing::trace_span!("line_index", ?file).entered();
|
let _span = tracing::trace_span!("line_index", ?file).entered();
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ impl Project {
|
||||||
/// This is a salsa query to prevent re-computing queries if other, unrelated
|
/// This is a salsa query to prevent re-computing queries if other, unrelated
|
||||||
/// settings change. For example, we don't want that changing the terminal settings
|
/// settings change. For example, we don't want that changing the terminal settings
|
||||||
/// invalidates any type checking queries.
|
/// invalidates any type checking queries.
|
||||||
#[salsa::tracked(returns(deref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(deref), heap_size=get_size2::heap_size)]
|
||||||
pub fn rules(self, db: &dyn Db) -> Arc<RuleSelection> {
|
pub fn rules(self, db: &dyn Db) -> Arc<RuleSelection> {
|
||||||
self.settings(db).to_rules()
|
self.settings(db).to_rules()
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@ impl Project {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(returns(ref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn check_file_impl(db: &dyn Db, file: File) -> Result<Box<[Diagnostic]>, Diagnostic> {
|
pub(crate) fn check_file_impl(db: &dyn Db, file: File) -> Result<Box<[Diagnostic]>, Diagnostic> {
|
||||||
let mut diagnostics: Vec<Diagnostic> = Vec::new();
|
let mut diagnostics: Vec<Diagnostic> = Vec::new();
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ impl Override {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resolves the settings for a given file.
|
/// Resolves the settings for a given file.
|
||||||
#[salsa::tracked(returns(ref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn file_settings(db: &dyn Db, file: File) -> FileSettings {
|
pub(crate) fn file_settings(db: &dyn Db, file: File) -> FileSettings {
|
||||||
let settings = db.project().settings(db);
|
let settings = db.project().settings(db);
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ pub(crate) fn file_settings(db: &dyn Db, file: File) -> FileSettings {
|
||||||
/// This is to make Salsa happy because it requires that queries with only a single argument
|
/// This is to make Salsa happy because it requires that queries with only a single argument
|
||||||
/// take a salsa-struct as argument, which isn't the case here. The `()` enables salsa's
|
/// take a salsa-struct as argument, which isn't the case here. The `()` enables salsa's
|
||||||
/// automatic interning for the arguments.
|
/// automatic interning for the arguments.
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
fn merge_overrides(db: &dyn Db, overrides: Vec<Arc<InnerOverrideOptions>>, _: ()) -> FileSettings {
|
fn merge_overrides(db: &dyn Db, overrides: Vec<Arc<InnerOverrideOptions>>, _: ()) -> FileSettings {
|
||||||
let mut overrides = overrides.into_iter().rev();
|
let mut overrides = overrides.into_iter().rev();
|
||||||
let mut merged = (*overrides.next().unwrap()).clone();
|
let mut merged = (*overrides.next().unwrap()).clone();
|
||||||
|
|
|
@ -26,7 +26,7 @@ fn dunder_all_names_cycle_initial(_db: &dyn Db, _file: File) -> Option<FxHashSet
|
||||||
|
|
||||||
/// Returns a set of names in the `__all__` variable for `file`, [`None`] if it is not defined or
|
/// Returns a set of names in the `__all__` variable for `file`, [`None`] if it is not defined or
|
||||||
/// if it contains invalid elements.
|
/// if it contains invalid elements.
|
||||||
#[salsa::tracked(returns(as_ref), cycle_fn=dunder_all_names_cycle_recover, cycle_initial=dunder_all_names_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(as_ref), cycle_fn=dunder_all_names_cycle_recover, cycle_initial=dunder_all_names_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn dunder_all_names(db: &dyn Db, file: File) -> Option<FxHashSet<Name>> {
|
pub(crate) fn dunder_all_names(db: &dyn Db, file: File) -> Option<FxHashSet<Name>> {
|
||||||
let _span = tracing::trace_span!("dunder_all_names", file=?file.path(db)).entered();
|
let _span = tracing::trace_span!("dunder_all_names", file=?file.path(db)).entered();
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ impl ModuleResolveMode {
|
||||||
///
|
///
|
||||||
/// This query should not be called directly. Instead, use [`resolve_module`]. It only exists
|
/// This query should not be called directly. Instead, use [`resolve_module`]. It only exists
|
||||||
/// because Salsa requires the module name to be an ingredient.
|
/// 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>(
|
fn resolve_module_query<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
module_name: ModuleNameIngredient<'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.
|
/// 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.
|
/// 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<'_>> {
|
pub(crate) fn file_to_module(db: &dyn Db, file: File) -> Option<Module<'_>> {
|
||||||
let _span = tracing::trace_span!("file_to_module", ?file).entered();
|
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
|
/// The editable-install search paths for the first `site-packages` directory
|
||||||
/// should come between the two `site-packages` directories when it comes to
|
/// should come between the two `site-packages` directories when it comes to
|
||||||
/// module-resolution priority.
|
/// 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> {
|
pub(crate) fn dynamic_resolution_paths(db: &dyn Db) -> Vec<SearchPath> {
|
||||||
tracing::debug!("Resolving dynamic module resolution paths");
|
tracing::debug!("Resolving dynamic module resolution paths");
|
||||||
|
|
||||||
|
|
|
@ -641,7 +641,7 @@ fn place_cycle_initial<'db>(
|
||||||
Place::bound(Type::Never).into()
|
Place::bound(Type::Never).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(cycle_fn=place_cycle_recover, cycle_initial=place_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=place_cycle_recover, cycle_initial=place_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
fn place_by_id<'db>(
|
fn place_by_id<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
scope: ScopeId<'db>,
|
scope: ScopeId<'db>,
|
||||||
|
@ -1368,7 +1368,7 @@ mod implicit_globals {
|
||||||
/// Conceptually this function could be a `Set` rather than a list,
|
/// Conceptually this function could be a `Set` rather than a list,
|
||||||
/// but the number of symbols declared in this scope is likely to be very small,
|
/// but the number of symbols declared in this scope is likely to be very small,
|
||||||
/// so the cost of hashing the names is likely to be more expensive than it's worth.
|
/// so the cost of hashing the names is likely to be more expensive than it's worth.
|
||||||
#[salsa::tracked(returns(deref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(deref), heap_size=get_size2::heap_size)]
|
||||||
fn module_type_symbols<'db>(db: &'db dyn Db) -> smallvec::SmallVec<[ast::name::Name; 8]> {
|
fn module_type_symbols<'db>(db: &'db dyn Db) -> smallvec::SmallVec<[ast::name::Name; 8]> {
|
||||||
let Some(module_type) = KnownClass::ModuleType
|
let Some(module_type) = KnownClass::ModuleType
|
||||||
.to_class_literal(db)
|
.to_class_literal(db)
|
||||||
|
|
|
@ -52,7 +52,7 @@ pub(crate) use self::use_def::{
|
||||||
/// Returns the semantic index for `file`.
|
/// Returns the semantic index for `file`.
|
||||||
///
|
///
|
||||||
/// Prefer using [`symbol_table`] when working with symbols from a single scope.
|
/// Prefer using [`symbol_table`] when working with symbols from a single scope.
|
||||||
#[salsa::tracked(returns(ref), no_eq, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), no_eq, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn semantic_index(db: &dyn Db, file: File) -> SemanticIndex<'_> {
|
pub(crate) fn semantic_index(db: &dyn Db, file: File) -> SemanticIndex<'_> {
|
||||||
let _span = tracing::trace_span!("semantic_index", ?file).entered();
|
let _span = tracing::trace_span!("semantic_index", ?file).entered();
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ pub(crate) fn semantic_index(db: &dyn Db, file: File) -> SemanticIndex<'_> {
|
||||||
/// Using [`place_table`] over [`semantic_index`] has the advantage that
|
/// Using [`place_table`] over [`semantic_index`] has the advantage that
|
||||||
/// Salsa can avoid invalidating dependent queries if this scope's place table
|
/// Salsa can avoid invalidating dependent queries if this scope's place table
|
||||||
/// is unchanged.
|
/// is unchanged.
|
||||||
#[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 place_table<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> Arc<PlaceTable> {
|
pub(crate) fn place_table<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> Arc<PlaceTable> {
|
||||||
let file = scope.file(db);
|
let file = scope.file(db);
|
||||||
let _span = tracing::trace_span!("place_table", scope=?scope.as_id(), ?file).entered();
|
let _span = tracing::trace_span!("place_table", scope=?scope.as_id(), ?file).entered();
|
||||||
|
@ -86,7 +86,7 @@ pub(crate) fn place_table<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> Arc<Plac
|
||||||
///
|
///
|
||||||
/// - We cannot resolve relative imports (which aren't allowed in `import` statements) without
|
/// - We cannot resolve relative imports (which aren't allowed in `import` statements) without
|
||||||
/// knowing the name of the current module, and whether it's a package.
|
/// knowing the name of the current module, and whether it's a package.
|
||||||
#[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 imported_modules<'db>(db: &'db dyn Db, file: File) -> Arc<FxHashSet<ModuleName>> {
|
pub(crate) fn imported_modules<'db>(db: &'db dyn Db, file: File) -> Arc<FxHashSet<ModuleName>> {
|
||||||
semantic_index(db, file).imported_modules.clone()
|
semantic_index(db, file).imported_modules.clone()
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ pub(crate) fn imported_modules<'db>(db: &'db dyn Db, file: File) -> Arc<FxHashSe
|
||||||
/// Using [`use_def_map`] over [`semantic_index`] has the advantage that
|
/// Using [`use_def_map`] over [`semantic_index`] has the advantage that
|
||||||
/// Salsa can avoid invalidating dependent queries if this scope's use-def map
|
/// Salsa can avoid invalidating dependent queries if this scope's use-def map
|
||||||
/// is unchanged.
|
/// is unchanged.
|
||||||
#[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 use_def_map<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> ArcUseDefMap<'db> {
|
pub(crate) fn use_def_map<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> ArcUseDefMap<'db> {
|
||||||
let file = scope.file(db);
|
let file = scope.file(db);
|
||||||
let _span = tracing::trace_span!("use_def_map", scope=?scope.as_id(), ?file).entered();
|
let _span = tracing::trace_span!("use_def_map", scope=?scope.as_id(), ?file).entered();
|
||||||
|
@ -184,7 +184,7 @@ pub(crate) fn attribute_scopes<'db, 's>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the module global scope of `file`.
|
/// Returns the module global scope of `file`.
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn global_scope(db: &dyn Db, file: File) -> ScopeId<'_> {
|
pub(crate) fn global_scope(db: &dyn Db, file: File) -> ScopeId<'_> {
|
||||||
let _span = tracing::trace_span!("global_scope", ?file).entered();
|
let _span = tracing::trace_span!("global_scope", ?file).entered();
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ fn exports_cycle_initial(_db: &dyn Db, _file: File) -> Box<[Name]> {
|
||||||
Box::default()
|
Box::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(returns(deref), cycle_fn=exports_cycle_recover, cycle_initial=exports_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(deref), cycle_fn=exports_cycle_recover, cycle_initial=exports_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(super) fn exported_names(db: &dyn Db, file: File) -> Box<[Name]> {
|
pub(super) fn exported_names(db: &dyn Db, file: File) -> Box<[Name]> {
|
||||||
let module = parsed_module(db, file).load(db);
|
let module = parsed_module(db, file).load(db);
|
||||||
let mut finder = ExportFinder::new(db, file);
|
let mut finder = ExportFinder::new(db, file);
|
||||||
|
|
|
@ -86,7 +86,7 @@ declare_lint! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(returns(ref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn suppressions(db: &dyn Db, file: File) -> Suppressions {
|
pub(crate) fn suppressions(db: &dyn Db, file: File) -> Suppressions {
|
||||||
let parsed = parsed_module(db, file).load(db);
|
let parsed = parsed_module(db, file).load(db);
|
||||||
let source = source_text(db, file);
|
let source = source_text(db, file);
|
||||||
|
|
|
@ -2578,7 +2578,7 @@ impl<'db> Type<'db> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
// If we choose name `_unit`, the macro will generate code that uses `_unit`, causing clippy to fail.
|
// If we choose name `_unit`, the macro will generate code that uses `_unit`, causing clippy to fail.
|
||||||
fn lookup_dunder_new(self, db: &'db dyn Db, unit: ()) -> Option<PlaceAndQualifiers<'db>> {
|
fn lookup_dunder_new(self, db: &'db dyn Db, unit: ()) -> Option<PlaceAndQualifiers<'db>> {
|
||||||
|
@ -2599,7 +2599,7 @@ impl<'db> Type<'db> {
|
||||||
self.class_member_with_policy(db, name, MemberLookupPolicy::default())
|
self.class_member_with_policy(db, name, MemberLookupPolicy::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(cycle_fn=class_lookup_cycle_recover, cycle_initial=class_lookup_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=class_lookup_cycle_recover, cycle_initial=class_lookup_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
fn class_member_with_policy(
|
fn class_member_with_policy(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -2760,7 +2760,7 @@ impl<'db> Type<'db> {
|
||||||
/// that `self` represents: (1) a data descriptor or (2) a non-data descriptor / normal attribute.
|
/// that `self` represents: (1) a data descriptor or (2) a non-data descriptor / normal attribute.
|
||||||
///
|
///
|
||||||
/// If `__get__` is not defined on the meta-type, this method returns `None`.
|
/// If `__get__` is not defined on the meta-type, this method returns `None`.
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn try_call_dunder_get(
|
pub(crate) fn try_call_dunder_get(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -3053,7 +3053,7 @@ impl<'db> Type<'db> {
|
||||||
|
|
||||||
/// Similar to [`Type::member`], but allows the caller to specify what policy should be used
|
/// Similar to [`Type::member`], but allows the caller to specify what policy should be used
|
||||||
/// when looking up attributes. See [`MemberLookupPolicy`] for more information.
|
/// when looking up attributes. See [`MemberLookupPolicy`] for more information.
|
||||||
#[salsa::tracked(cycle_fn=member_lookup_cycle_recover, cycle_initial=member_lookup_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=member_lookup_cycle_recover, cycle_initial=member_lookup_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
fn member_lookup_with_policy(
|
fn member_lookup_with_policy(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -5550,7 +5550,7 @@ impl<'db> Type<'db> {
|
||||||
/// Note that this does not specialize generic classes, functions, or type aliases! That is a
|
/// Note that this does not specialize generic classes, functions, or type aliases! That is a
|
||||||
/// different operation that is performed explicitly (via a subscript operation), or implicitly
|
/// different operation that is performed explicitly (via a subscript operation), or implicitly
|
||||||
/// via a call to the generic object.
|
/// via a call to the generic object.
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
pub fn apply_specialization(
|
pub fn apply_specialization(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -8140,7 +8140,7 @@ impl<'db> PEP695TypeAliasType<'db> {
|
||||||
semantic_index(db, scope.file(db)).expect_single_definition(type_alias_stmt_node)
|
semantic_index(db, scope.file(db)).expect_single_definition(type_alias_stmt_node)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn value_type(self, db: &'db dyn Db) -> Type<'db> {
|
pub(crate) fn value_type(self, db: &'db dyn Db) -> Type<'db> {
|
||||||
let scope = self.rhs_scope(db);
|
let scope = self.rhs_scope(db);
|
||||||
let module = parsed_module(db, scope.file(db)).load(db);
|
let module = parsed_module(db, scope.file(db)).load(db);
|
||||||
|
|
|
@ -1150,7 +1150,7 @@ impl<'db> ClassLiteral<'db> {
|
||||||
self.pep695_generic_context(db).is_some()
|
self.pep695_generic_context(db).is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(cycle_fn=pep695_generic_context_cycle_recover, cycle_initial=pep695_generic_context_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=pep695_generic_context_cycle_recover, cycle_initial=pep695_generic_context_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn pep695_generic_context(self, db: &'db dyn Db) -> Option<GenericContext<'db>> {
|
pub(crate) fn pep695_generic_context(self, db: &'db dyn Db) -> Option<GenericContext<'db>> {
|
||||||
let scope = self.body_scope(db);
|
let scope = self.body_scope(db);
|
||||||
let parsed = parsed_module(db, scope.file(db)).load(db);
|
let parsed = parsed_module(db, scope.file(db)).load(db);
|
||||||
|
@ -1260,7 +1260,7 @@ impl<'db> ClassLiteral<'db> {
|
||||||
///
|
///
|
||||||
/// Were this not a salsa query, then the calling query
|
/// Were this not a salsa query, then the calling query
|
||||||
/// would depend on the class's AST and rerun for every change in that file.
|
/// would depend on the class's AST and rerun for every change in that file.
|
||||||
#[salsa::tracked(returns(deref), cycle_fn=explicit_bases_cycle_recover, cycle_initial=explicit_bases_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(deref), cycle_fn=explicit_bases_cycle_recover, cycle_initial=explicit_bases_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(super) fn explicit_bases(self, db: &'db dyn Db) -> Box<[Type<'db>]> {
|
pub(super) fn explicit_bases(self, db: &'db dyn Db) -> Box<[Type<'db>]> {
|
||||||
tracing::trace!("ClassLiteral::explicit_bases_query: {}", self.name(db));
|
tracing::trace!("ClassLiteral::explicit_bases_query: {}", self.name(db));
|
||||||
|
|
||||||
|
@ -1336,7 +1336,7 @@ impl<'db> ClassLiteral<'db> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the types of the decorators on this class
|
/// Return the types of the decorators on this class
|
||||||
#[salsa::tracked(returns(deref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(deref), heap_size=get_size2::heap_size)]
|
||||||
fn decorators(self, db: &'db dyn Db) -> Box<[Type<'db>]> {
|
fn decorators(self, db: &'db dyn Db) -> Box<[Type<'db>]> {
|
||||||
tracing::trace!("ClassLiteral::decorators: {}", self.name(db));
|
tracing::trace!("ClassLiteral::decorators: {}", self.name(db));
|
||||||
|
|
||||||
|
@ -1385,7 +1385,7 @@ impl<'db> ClassLiteral<'db> {
|
||||||
/// attribute on a class at runtime.
|
/// attribute on a class at runtime.
|
||||||
///
|
///
|
||||||
/// [method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order
|
/// [method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order
|
||||||
#[salsa::tracked(returns(as_ref), cycle_fn=try_mro_cycle_recover, cycle_initial=try_mro_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(as_ref), cycle_fn=try_mro_cycle_recover, cycle_initial=try_mro_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(super) fn try_mro(
|
pub(super) fn try_mro(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -1465,7 +1465,7 @@ impl<'db> ClassLiteral<'db> {
|
||||||
#[salsa::tracked(
|
#[salsa::tracked(
|
||||||
cycle_fn=try_metaclass_cycle_recover,
|
cycle_fn=try_metaclass_cycle_recover,
|
||||||
cycle_initial=try_metaclass_cycle_initial,
|
cycle_initial=try_metaclass_cycle_initial,
|
||||||
heap_size=get_size2::GetSize::get_heap_size,
|
heap_size=get_size2::heap_size,
|
||||||
)]
|
)]
|
||||||
pub(super) fn try_metaclass(
|
pub(super) fn try_metaclass(
|
||||||
self,
|
self,
|
||||||
|
@ -2577,7 +2577,7 @@ impl<'db> ClassLiteral<'db> {
|
||||||
///
|
///
|
||||||
/// A class definition like this will fail at runtime,
|
/// A class definition like this will fail at runtime,
|
||||||
/// but we must be resilient to it or we could panic.
|
/// but we must be resilient to it or we could panic.
|
||||||
#[salsa::tracked(cycle_fn=inheritance_cycle_recover, cycle_initial=inheritance_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=inheritance_cycle_recover, cycle_initial=inheritance_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(super) fn inheritance_cycle(self, db: &'db dyn Db) -> Option<InheritanceCycle> {
|
pub(super) fn inheritance_cycle(self, db: &'db dyn Db) -> Option<InheritanceCycle> {
|
||||||
/// Return `true` if the class is cyclically defined.
|
/// Return `true` if the class is cyclically defined.
|
||||||
///
|
///
|
||||||
|
|
|
@ -53,7 +53,7 @@ fn enum_metadata_cycle_initial(_db: &dyn Db, _class: ClassLiteral<'_>) -> Option
|
||||||
|
|
||||||
/// List all members of an enum.
|
/// List all members of an enum.
|
||||||
#[allow(clippy::ref_option, clippy::unnecessary_wraps)]
|
#[allow(clippy::ref_option, clippy::unnecessary_wraps)]
|
||||||
#[salsa::tracked(returns(as_ref), cycle_fn=enum_metadata_cycle_recover, cycle_initial=enum_metadata_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(as_ref), cycle_fn=enum_metadata_cycle_recover, cycle_initial=enum_metadata_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn enum_metadata<'db>(
|
pub(crate) fn enum_metadata<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
class: ClassLiteral<'db>,
|
class: ClassLiteral<'db>,
|
||||||
|
|
|
@ -499,7 +499,7 @@ impl<'db> FunctionLiteral<'db> {
|
||||||
self.last_definition(db).spans(db)
|
self.last_definition(db).spans(db)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(returns(ref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), heap_size=get_size2::heap_size)]
|
||||||
fn overloads_and_implementation(
|
fn overloads_and_implementation(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -790,7 +790,7 @@ impl<'db> FunctionType<'db> {
|
||||||
///
|
///
|
||||||
/// Were this not a salsa query, then the calling query
|
/// Were this not a salsa query, then the calling query
|
||||||
/// would depend on the function's AST and rerun for every change in that file.
|
/// would depend on the function's AST and rerun for every change in that file.
|
||||||
#[salsa::tracked(returns(ref), cycle_fn=signature_cycle_recover, cycle_initial=signature_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), cycle_fn=signature_cycle_recover, cycle_initial=signature_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn signature(self, db: &'db dyn Db) -> CallableSignature<'db> {
|
pub(crate) fn signature(self, db: &'db dyn Db) -> CallableSignature<'db> {
|
||||||
self.literal(db).signature(db, self.type_mappings(db))
|
self.literal(db).signature(db, self.type_mappings(db))
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ use crate::{Db, FxOrderSet, Program};
|
||||||
/// Infer all types for a [`ScopeId`], including all definitions and expressions in that scope.
|
/// Infer all types for a [`ScopeId`], including all definitions and expressions in that scope.
|
||||||
/// Use when checking a scope, or needing to provide a type for an arbitrary expression in the
|
/// Use when checking a scope, or needing to provide a type for an arbitrary expression in the
|
||||||
/// scope.
|
/// scope.
|
||||||
#[salsa::tracked(returns(ref), cycle_fn=scope_cycle_recover, cycle_initial=scope_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), cycle_fn=scope_cycle_recover, cycle_initial=scope_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn infer_scope_types<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> ScopeInference<'db> {
|
pub(crate) fn infer_scope_types<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> ScopeInference<'db> {
|
||||||
let file = scope.file(db);
|
let file = scope.file(db);
|
||||||
let _span = tracing::trace_span!("infer_scope_types", scope=?scope.as_id(), ?file).entered();
|
let _span = tracing::trace_span!("infer_scope_types", scope=?scope.as_id(), ?file).entered();
|
||||||
|
@ -160,7 +160,7 @@ fn scope_cycle_initial<'db>(_db: &'db dyn Db, scope: ScopeId<'db>) -> ScopeInfer
|
||||||
|
|
||||||
/// Infer all types for a [`Definition`] (including sub-expressions).
|
/// Infer all types for a [`Definition`] (including sub-expressions).
|
||||||
/// Use when resolving a place use or public type of a place.
|
/// Use when resolving a place use or public type of a place.
|
||||||
#[salsa::tracked(returns(ref), cycle_fn=definition_cycle_recover, cycle_initial=definition_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), cycle_fn=definition_cycle_recover, cycle_initial=definition_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn infer_definition_types<'db>(
|
pub(crate) fn infer_definition_types<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
definition: Definition<'db>,
|
definition: Definition<'db>,
|
||||||
|
@ -200,7 +200,7 @@ fn definition_cycle_initial<'db>(
|
||||||
///
|
///
|
||||||
/// Deferred expressions are type expressions (annotations, base classes, aliases...) in a stub
|
/// Deferred expressions are type expressions (annotations, base classes, aliases...) in a stub
|
||||||
/// file, or in a file with `from __future__ import annotations`, or stringified annotations.
|
/// file, or in a file with `from __future__ import annotations`, or stringified annotations.
|
||||||
#[salsa::tracked(returns(ref), cycle_fn=deferred_cycle_recover, cycle_initial=deferred_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), cycle_fn=deferred_cycle_recover, cycle_initial=deferred_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn infer_deferred_types<'db>(
|
pub(crate) fn infer_deferred_types<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
definition: Definition<'db>,
|
definition: Definition<'db>,
|
||||||
|
@ -241,7 +241,7 @@ fn deferred_cycle_initial<'db>(
|
||||||
/// Use rarely; only for cases where we'd otherwise risk double-inferring an expression: RHS of an
|
/// Use rarely; only for cases where we'd otherwise risk double-inferring an expression: RHS of an
|
||||||
/// assignment, which might be unpacking/multi-target and thus part of multiple definitions, or a
|
/// assignment, which might be unpacking/multi-target and thus part of multiple definitions, or a
|
||||||
/// type narrowing guard expression (e.g. if statement test node).
|
/// type narrowing guard expression (e.g. if statement test node).
|
||||||
#[salsa::tracked(returns(ref), cycle_fn=expression_cycle_recover, cycle_initial=expression_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), cycle_fn=expression_cycle_recover, cycle_initial=expression_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn infer_expression_types<'db>(
|
pub(crate) fn infer_expression_types<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
expression: Expression<'db>,
|
expression: Expression<'db>,
|
||||||
|
@ -299,7 +299,7 @@ pub(super) fn infer_same_file_expression_type<'db>(
|
||||||
///
|
///
|
||||||
/// Use [`infer_same_file_expression_type`] if it is guaranteed that `expression` is in the same
|
/// Use [`infer_same_file_expression_type`] if it is guaranteed that `expression` is in the same
|
||||||
/// to avoid unnecessary salsa ingredients. This is normally the case inside the `TypeInferenceBuilder`.
|
/// to avoid unnecessary salsa ingredients. This is normally the case inside the `TypeInferenceBuilder`.
|
||||||
#[salsa::tracked(cycle_fn=single_expression_cycle_recover, cycle_initial=single_expression_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=single_expression_cycle_recover, cycle_initial=single_expression_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(crate) fn infer_expression_type<'db>(
|
pub(crate) fn infer_expression_type<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
expression: Expression<'db>,
|
expression: Expression<'db>,
|
||||||
|
@ -333,7 +333,7 @@ fn single_expression_cycle_initial<'db>(
|
||||||
/// involved in an unpacking operation. It returns a result-like object that can be used to get the
|
/// involved in an unpacking operation. It returns a result-like object that can be used to get the
|
||||||
/// type of the variables involved in this unpacking along with any violations that are detected
|
/// type of the variables involved in this unpacking along with any violations that are detected
|
||||||
/// during this unpacking.
|
/// during this unpacking.
|
||||||
#[salsa::tracked(returns(ref), cycle_fn=unpack_cycle_recover, cycle_initial=unpack_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(ref), cycle_fn=unpack_cycle_recover, cycle_initial=unpack_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
pub(super) fn infer_unpack_types<'db>(db: &'db dyn Db, unpack: Unpack<'db>) -> UnpackResult<'db> {
|
pub(super) fn infer_unpack_types<'db>(db: &'db dyn Db, unpack: Unpack<'db>) -> UnpackResult<'db> {
|
||||||
let file = unpack.file(db);
|
let file = unpack.file(db);
|
||||||
let module = parsed_module(db, file).load(db);
|
let module = parsed_module(db, file).load(db);
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub(crate) fn infer_narrowing_constraint<'db>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(returns(as_ref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(as_ref), heap_size=get_size2::heap_size)]
|
||||||
fn all_narrowing_constraints_for_pattern<'db>(
|
fn all_narrowing_constraints_for_pattern<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
pattern: PatternPredicate<'db>,
|
pattern: PatternPredicate<'db>,
|
||||||
|
@ -85,7 +85,7 @@ fn all_narrowing_constraints_for_pattern<'db>(
|
||||||
returns(as_ref),
|
returns(as_ref),
|
||||||
cycle_fn=constraints_for_expression_cycle_recover,
|
cycle_fn=constraints_for_expression_cycle_recover,
|
||||||
cycle_initial=constraints_for_expression_cycle_initial,
|
cycle_initial=constraints_for_expression_cycle_initial,
|
||||||
heap_size=get_size2::GetSize::get_heap_size,
|
heap_size=get_size2::heap_size,
|
||||||
)]
|
)]
|
||||||
fn all_narrowing_constraints_for_expression<'db>(
|
fn all_narrowing_constraints_for_expression<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -100,7 +100,7 @@ fn all_narrowing_constraints_for_expression<'db>(
|
||||||
returns(as_ref),
|
returns(as_ref),
|
||||||
cycle_fn=negative_constraints_for_expression_cycle_recover,
|
cycle_fn=negative_constraints_for_expression_cycle_recover,
|
||||||
cycle_initial=negative_constraints_for_expression_cycle_initial,
|
cycle_initial=negative_constraints_for_expression_cycle_initial,
|
||||||
heap_size=get_size2::GetSize::get_heap_size,
|
heap_size=get_size2::heap_size,
|
||||||
)]
|
)]
|
||||||
fn all_negative_narrowing_constraints_for_expression<'db>(
|
fn all_negative_narrowing_constraints_for_expression<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
|
@ -111,7 +111,7 @@ fn all_negative_narrowing_constraints_for_expression<'db>(
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(returns(as_ref), heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(returns(as_ref), heap_size=get_size2::heap_size)]
|
||||||
fn all_negative_narrowing_constraints_for_pattern<'db>(
|
fn all_negative_narrowing_constraints_for_pattern<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
pattern: PatternPredicate<'db>,
|
pattern: PatternPredicate<'db>,
|
||||||
|
|
|
@ -115,7 +115,7 @@ enum ParamKind {
|
||||||
KeywordVariadic,
|
KeywordVariadic,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(heap_size=get_size2::heap_size)]
|
||||||
fn create_bound_method<'db>(
|
fn create_bound_method<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
function: Type<'db>,
|
function: Type<'db>,
|
||||||
|
|
|
@ -453,7 +453,7 @@ enum BoundOnClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inner Salsa query for [`ProtocolClassLiteral::interface`].
|
/// Inner Salsa query for [`ProtocolClassLiteral::interface`].
|
||||||
#[salsa::tracked(cycle_fn=proto_interface_cycle_recover, cycle_initial=proto_interface_cycle_initial, heap_size=get_size2::GetSize::get_heap_size)]
|
#[salsa::tracked(cycle_fn=proto_interface_cycle_recover, cycle_initial=proto_interface_cycle_initial, heap_size=get_size2::heap_size)]
|
||||||
fn cached_protocol_interface<'db>(
|
fn cached_protocol_interface<'db>(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
class: ClassLiteral<'db>,
|
class: ClassLiteral<'db>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue