Skip to content

Commit 2b58705

Browse files
authored
Remove the optional salsa dependency from the AST crate (astral-sh#14363)
1 parent 9f3235a commit 2b58705

5 files changed

Lines changed: 3 additions & 21 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/red_knot_python_semantic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ license = { workspace = true }
1313
[dependencies]
1414
ruff_db = { workspace = true }
1515
ruff_index = { workspace = true }
16-
ruff_python_ast = { workspace = true, features = ["salsa"] }
16+
ruff_python_ast = { workspace = true }
1717
ruff_python_parser = { workspace = true }
1818
ruff_python_stdlib = { workspace = true }
1919
ruff_source_file = { workspace = true }

crates/red_knot_python_semantic/src/types/infer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ impl<'db> TypeInferenceBuilder<'db> {
954954

955955
let function_ty = Type::FunctionLiteral(FunctionType::new(
956956
self.db,
957-
&*name.id,
957+
&name.id,
958958
function_kind,
959959
body_scope,
960960
decorator_tys,
@@ -1069,7 +1069,7 @@ impl<'db> TypeInferenceBuilder<'db> {
10691069

10701070
let maybe_known_class = KnownClass::try_from_file(self.db, self.file, name);
10711071

1072-
let class = Class::new(self.db, &*name.id, body_scope, maybe_known_class);
1072+
let class = Class::new(self.db, &name.id, body_scope, maybe_known_class);
10731073
let class_ty = Type::class_literal(class);
10741074

10751075
self.add_declaration_with_binding(class_node.into(), definition, class_ty, class_ty);

crates/ruff_python_ast/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ is-macro = { workspace = true }
2626
itertools = { workspace = true }
2727
memchr = { workspace = true }
2828
rustc-hash = { workspace = true }
29-
salsa = { workspace = true, optional = true }
3029
schemars = { workspace = true, optional = true }
3130
serde = { workspace = true, optional = true }
3231

@@ -39,7 +38,6 @@ serde = [
3938
"dep:ruff_cache",
4039
"compact_str/serde",
4140
]
42-
salsa = ["dep:salsa"]
4341

4442
[lints]
4543
workspace = true

crates/ruff_python_ast/src/name.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,21 +205,6 @@ impl schemars::JsonSchema for Name {
205205
}
206206
}
207207

208-
#[cfg(feature = "salsa")]
209-
impl salsa::plumbing::interned::Lookup<Name> for &str {
210-
fn hash<H: Hasher>(&self, h: &mut H) {
211-
std::hash::Hash::hash(self, h);
212-
}
213-
214-
fn eq(&self, data: &Name) -> bool {
215-
self == data
216-
}
217-
218-
fn into_owned(self) -> Name {
219-
Name::new(self)
220-
}
221-
}
222-
223208
/// A representation of a qualified name, like `typing.List`.
224209
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
225210
pub struct QualifiedName<'a>(SegmentsVec<'a>);

0 commit comments

Comments
 (0)