mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:16 +00:00
[ty] Remove countme from salsa-structs (#19257)
This commit is contained in:
parent
934aaa23f3
commit
492f5bf2aa
10 changed files with 20 additions and 67 deletions
64
Cargo.lock
generated
64
Cargo.lock
generated
|
@ -680,11 +680,6 @@ name = "countme"
|
||||||
version = "3.0.1"
|
version = "3.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
|
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
|
||||||
dependencies = [
|
|
||||||
"dashmap 5.5.3",
|
|
||||||
"once_cell",
|
|
||||||
"rustc-hash 1.1.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpufeatures"
|
name = "cpufeatures"
|
||||||
|
@ -852,19 +847,6 @@ dependencies = [
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dashmap"
|
|
||||||
version = "5.5.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"hashbrown 0.14.5",
|
|
||||||
"lock_api",
|
|
||||||
"once_cell",
|
|
||||||
"parking_lot_core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dashmap"
|
name = "dashmap"
|
||||||
version = "6.1.0"
|
version = "6.1.0"
|
||||||
|
@ -2262,7 +2244,7 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pep440_rs",
|
"pep440_rs",
|
||||||
"regex",
|
"regex",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"thiserror 1.0.69",
|
"thiserror 1.0.69",
|
||||||
|
@ -2772,7 +2754,7 @@ dependencies = [
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"ruff_workspace",
|
"ruff_workspace",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
|
@ -2818,7 +2800,7 @@ dependencies = [
|
||||||
"ruff_python_formatter",
|
"ruff_python_formatter",
|
||||||
"ruff_python_parser",
|
"ruff_python_parser",
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tikv-jemallocator",
|
"tikv-jemallocator",
|
||||||
|
@ -2847,7 +2829,7 @@ dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"camino",
|
"camino",
|
||||||
"countme",
|
"countme",
|
||||||
"dashmap 6.1.0",
|
"dashmap",
|
||||||
"dunce",
|
"dunce",
|
||||||
"etcetera",
|
"etcetera",
|
||||||
"filetime",
|
"filetime",
|
||||||
|
@ -2866,7 +2848,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -2940,7 +2922,7 @@ dependencies = [
|
||||||
"ruff_cache",
|
"ruff_cache",
|
||||||
"ruff_macros",
|
"ruff_macros",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
|
@ -3022,7 +3004,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -3094,7 +3076,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -3144,7 +3126,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -3193,7 +3175,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
|
@ -3217,7 +3199,7 @@ dependencies = [
|
||||||
"ruff_python_parser",
|
"ruff_python_parser",
|
||||||
"ruff_python_stdlib",
|
"ruff_python_stdlib",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
@ -3278,7 +3260,7 @@ dependencies = [
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"ruff_workspace",
|
"ruff_workspace",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
|
@ -3367,7 +3349,7 @@ dependencies = [
|
||||||
"ruff_python_semantic",
|
"ruff_python_semantic",
|
||||||
"ruff_python_stdlib",
|
"ruff_python_stdlib",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
|
@ -3386,12 +3368,6 @@ dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc-hash"
|
|
||||||
version = "1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-hash"
|
name = "rustc-hash"
|
||||||
version = "2.1.1"
|
version = "2.1.1"
|
||||||
|
@ -3446,7 +3422,7 @@ dependencies = [
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"portable-atomic",
|
"portable-atomic",
|
||||||
"rayon",
|
"rayon",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa-macro-rules",
|
"salsa-macro-rules",
|
||||||
"salsa-macros",
|
"salsa-macros",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
@ -4144,7 +4120,6 @@ dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"clap_complete_command",
|
"clap_complete_command",
|
||||||
"colored 3.0.0",
|
"colored 3.0.0",
|
||||||
"countme",
|
|
||||||
"crossbeam",
|
"crossbeam",
|
||||||
"ctrlc",
|
"ctrlc",
|
||||||
"dunce",
|
"dunce",
|
||||||
|
@ -4181,7 +4156,7 @@ dependencies = [
|
||||||
"ruff_python_ast",
|
"ruff_python_ast",
|
||||||
"ruff_python_parser",
|
"ruff_python_parser",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
@ -4213,7 +4188,7 @@ dependencies = [
|
||||||
"ruff_python_ast",
|
"ruff_python_ast",
|
||||||
"ruff_python_formatter",
|
"ruff_python_formatter",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -4234,7 +4209,6 @@ dependencies = [
|
||||||
"camino",
|
"camino",
|
||||||
"colored 3.0.0",
|
"colored 3.0.0",
|
||||||
"compact_str",
|
"compact_str",
|
||||||
"countme",
|
|
||||||
"dir-test",
|
"dir-test",
|
||||||
"drop_bomb",
|
"drop_bomb",
|
||||||
"get-size2",
|
"get-size2",
|
||||||
|
@ -4258,7 +4232,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -4290,7 +4264,7 @@ dependencies = [
|
||||||
"ruff_notebook",
|
"ruff_notebook",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -4328,7 +4302,7 @@ dependencies = [
|
||||||
"ruff_python_trivia",
|
"ruff_python_trivia",
|
||||||
"ruff_source_file",
|
"ruff_source_file",
|
||||||
"ruff_text_size",
|
"ruff_text_size",
|
||||||
"rustc-hash 2.1.1",
|
"rustc-hash",
|
||||||
"rustc-stable-hash",
|
"rustc-stable-hash",
|
||||||
"salsa",
|
"salsa",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -26,7 +26,6 @@ argfile = { workspace = true }
|
||||||
clap = { workspace = true, features = ["wrap_help", "string", "env"] }
|
clap = { workspace = true, features = ["wrap_help", "string", "env"] }
|
||||||
clap_complete_command = { workspace = true }
|
clap_complete_command = { workspace = true }
|
||||||
colored = { workspace = true }
|
colored = { workspace = true }
|
||||||
countme = { workspace = true, features = ["enable"] }
|
|
||||||
crossbeam = { workspace = true }
|
crossbeam = { workspace = true }
|
||||||
ctrlc = { version = "3.4.4" }
|
ctrlc = { version = "3.4.4" }
|
||||||
indicatif = { workspace = true }
|
indicatif = { workspace = true }
|
||||||
|
|
|
@ -59,7 +59,6 @@ fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> {
|
||||||
set_colored_override(args.color);
|
set_colored_override(args.color);
|
||||||
|
|
||||||
let verbosity = args.verbosity.level();
|
let verbosity = args.verbosity.level();
|
||||||
countme::enable(verbosity.is_trace());
|
|
||||||
let _guard = setup_tracing(verbosity, args.color.unwrap_or_default())?;
|
let _guard = setup_tracing(verbosity, args.color.unwrap_or_default())?;
|
||||||
|
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
|
@ -152,8 +151,6 @@ fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> {
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::trace!("Counts for entire CLI run:\n{}", countme::get_all());
|
|
||||||
|
|
||||||
std::mem::forget(db);
|
std::mem::forget(db);
|
||||||
|
|
||||||
if exit_zero {
|
if exit_zero {
|
||||||
|
@ -353,8 +350,6 @@ impl MainLoop {
|
||||||
"Discarding check result for outdated revision: current: {revision}, result revision: {check_revision}"
|
"Discarding check result for outdated revision: current: {revision}, result revision: {check_revision}"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::trace!("Counts after last check:\n{}", countme::get_all());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainLoopMessage::ApplyChanges(changes) => {
|
MainLoopMessage::ApplyChanges(changes) => {
|
||||||
|
|
|
@ -29,7 +29,6 @@ bitflags = { workspace = true }
|
||||||
camino = { workspace = true }
|
camino = { workspace = true }
|
||||||
colored = { workspace = true }
|
colored = { workspace = true }
|
||||||
compact_str = { workspace = true }
|
compact_str = { workspace = true }
|
||||||
countme = { workspace = true }
|
|
||||||
drop_bomb = { workspace = true }
|
drop_bomb = { workspace = true }
|
||||||
get-size2 = { workspace = true }
|
get-size2 = { workspace = true }
|
||||||
indexmap = { workspace = true }
|
indexmap = { workspace = true }
|
||||||
|
|
|
@ -259,7 +259,7 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
|
||||||
.push(UseDefMapBuilder::new(is_class_scope));
|
.push(UseDefMapBuilder::new(is_class_scope));
|
||||||
let ast_id_scope = self.ast_ids.push(AstIdsBuilder::default());
|
let ast_id_scope = self.ast_ids.push(AstIdsBuilder::default());
|
||||||
|
|
||||||
let scope_id = ScopeId::new(self.db, self.file, file_scope_id, countme::Count::default());
|
let scope_id = ScopeId::new(self.db, self.file, file_scope_id);
|
||||||
|
|
||||||
self.scope_ids_by_scope.push(scope_id);
|
self.scope_ids_by_scope.push(scope_id);
|
||||||
let previous = self.scopes_by_node.insert(node.node_key(), file_scope_id);
|
let previous = self.scopes_by_node.insert(node.node_key(), file_scope_id);
|
||||||
|
@ -495,7 +495,6 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
|
||||||
place,
|
place,
|
||||||
kind,
|
kind,
|
||||||
is_reexported,
|
is_reexported,
|
||||||
countme::Count::default(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let num_definitions = {
|
let num_definitions = {
|
||||||
|
@ -731,7 +730,6 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
|
||||||
subject,
|
subject,
|
||||||
kind,
|
kind,
|
||||||
guard,
|
guard,
|
||||||
countme::Count::default(),
|
|
||||||
);
|
);
|
||||||
let predicate = PredicateOrLiteral::Predicate(Predicate {
|
let predicate = PredicateOrLiteral::Predicate(Predicate {
|
||||||
node: PredicateNode::Pattern(pattern_predicate),
|
node: PredicateNode::Pattern(pattern_predicate),
|
||||||
|
@ -781,7 +779,6 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
|
||||||
AstNodeRef::new(self.module, expression_node),
|
AstNodeRef::new(self.module, expression_node),
|
||||||
assigned_to.map(|assigned_to| AstNodeRef::new(self.module, assigned_to)),
|
assigned_to.map(|assigned_to| AstNodeRef::new(self.module, assigned_to)),
|
||||||
expression_kind,
|
expression_kind,
|
||||||
countme::Count::default(),
|
|
||||||
);
|
);
|
||||||
self.expressions_by_node
|
self.expressions_by_node
|
||||||
.insert(expression_node.into(), expression);
|
.insert(expression_node.into(), expression);
|
||||||
|
@ -986,7 +983,6 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
|
||||||
// Note `target` belongs to the `self.module` tree
|
// Note `target` belongs to the `self.module` tree
|
||||||
AstNodeRef::new(self.module, target),
|
AstNodeRef::new(self.module, target),
|
||||||
UnpackValue::new(unpackable.kind(), value),
|
UnpackValue::new(unpackable.kind(), value),
|
||||||
countme::Count::default(),
|
|
||||||
));
|
));
|
||||||
Some(unpackable.as_current_assignment(unpack))
|
Some(unpackable.as_current_assignment(unpack))
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,6 @@ pub struct Definition<'db> {
|
||||||
|
|
||||||
/// This is a dedicated field to avoid accessing `kind` to compute this value.
|
/// This is a dedicated field to avoid accessing `kind` to compute this value.
|
||||||
pub(crate) is_reexported: bool,
|
pub(crate) is_reexported: bool,
|
||||||
|
|
||||||
count: countme::Count<Definition<'static>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Salsa heap is tracked separately.
|
// The Salsa heap is tracked separately.
|
||||||
|
|
|
@ -58,8 +58,6 @@ pub(crate) struct Expression<'db> {
|
||||||
|
|
||||||
/// Should this expression be inferred as a normal expression or a type expression?
|
/// Should this expression be inferred as a normal expression or a type expression?
|
||||||
pub(crate) kind: ExpressionKind,
|
pub(crate) kind: ExpressionKind,
|
||||||
|
|
||||||
count: countme::Count<Expression<'static>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Salsa heap is tracked separately.
|
// The Salsa heap is tracked separately.
|
||||||
|
|
|
@ -441,8 +441,6 @@ pub struct ScopeId<'db> {
|
||||||
pub file: File,
|
pub file: File,
|
||||||
|
|
||||||
pub file_scope_id: FileScopeId,
|
pub file_scope_id: FileScopeId,
|
||||||
|
|
||||||
count: countme::Count<ScopeId<'static>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Salsa heap is tracked separately.
|
// The Salsa heap is tracked separately.
|
||||||
|
|
|
@ -138,8 +138,6 @@ pub(crate) struct PatternPredicate<'db> {
|
||||||
pub(crate) kind: PatternPredicateKind<'db>,
|
pub(crate) kind: PatternPredicateKind<'db>,
|
||||||
|
|
||||||
pub(crate) guard: Option<Expression<'db>>,
|
pub(crate) guard: Option<Expression<'db>>,
|
||||||
|
|
||||||
count: countme::Count<PatternPredicate<'static>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Salsa heap is tracked separately.
|
// The Salsa heap is tracked separately.
|
||||||
|
|
|
@ -44,8 +44,6 @@ pub(crate) struct Unpack<'db> {
|
||||||
/// The ingredient representing the value expression of the unpacking. For example, in
|
/// The ingredient representing the value expression of the unpacking. For example, in
|
||||||
/// `(a, b) = (1, 2)`, the value expression is `(1, 2)`.
|
/// `(a, b) = (1, 2)`, the value expression is `(1, 2)`.
|
||||||
pub(crate) value: UnpackValue<'db>,
|
pub(crate) value: UnpackValue<'db>,
|
||||||
|
|
||||||
count: countme::Count<Unpack<'static>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'db> Unpack<'db> {
|
impl<'db> Unpack<'db> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue