From e900cfb3ab6365236648798244334fe3b1586c9d Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Thu, 29 May 2025 11:10:03 +0200 Subject: [PATCH] Update salsa past generational id change --- Cargo.lock | 29 ++++++++++++++++++++------ Cargo.toml | 2 +- crates/ruff_db/src/testing.rs | 10 ++++----- crates/ty_python_semantic/src/types.rs | 2 +- fuzz/Cargo.toml | 2 +- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b1f0f82c5b31..bd7d909eb6499 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,18 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -1106,6 +1118,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hashbrown" @@ -3177,13 +3193,14 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "salsa" -version = "0.21.1" -source = "git+https://github.com/salsa-rs/salsa.git?rev=4818b15f3b7516555d39f5a41cb75970448bee4c#4818b15f3b7516555d39f5a41cb75970448bee4c" +version = "0.22.0" +source = "git+https://github.com/salsa-rs/salsa.git?rev=40d7844a7a7449a136e0946920a678b55a82f30b#40d7844a7a7449a136e0946920a678b55a82f30b" dependencies = [ "boxcar", "compact_str", "crossbeam-queue", "dashmap 6.1.0", + "hashbrown 0.14.5", "hashbrown 0.15.3", "hashlink", "indexmap", @@ -3200,13 +3217,13 @@ dependencies = [ [[package]] name = "salsa-macro-rules" -version = "0.21.1" -source = "git+https://github.com/salsa-rs/salsa.git?rev=4818b15f3b7516555d39f5a41cb75970448bee4c#4818b15f3b7516555d39f5a41cb75970448bee4c" +version = "0.22.0" +source = "git+https://github.com/salsa-rs/salsa.git?rev=40d7844a7a7449a136e0946920a678b55a82f30b#40d7844a7a7449a136e0946920a678b55a82f30b" [[package]] name = "salsa-macros" -version = "0.21.1" -source = "git+https://github.com/salsa-rs/salsa.git?rev=4818b15f3b7516555d39f5a41cb75970448bee4c#4818b15f3b7516555d39f5a41cb75970448bee4c" +version = "0.22.0" +source = "git+https://github.com/salsa-rs/salsa.git?rev=40d7844a7a7449a136e0946920a678b55a82f30b#40d7844a7a7449a136e0946920a678b55a82f30b" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 80f7825dc0348..1b01cf219cd9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -129,7 +129,7 @@ regex = { version = "1.10.2" } rustc-hash = { version = "2.0.0" } rustc-stable-hash = { version = "0.1.2" } # When updating salsa, make sure to also update the revision in `fuzz/Cargo.toml` -salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "4818b15f3b7516555d39f5a41cb75970448bee4c" } +salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "40d7844a7a7449a136e0946920a678b55a82f30b" } schemars = { version = "0.8.16" } seahash = { version = "4.1.0" } serde = { version = "1.0.197", features = ["derive"] } diff --git a/crates/ruff_db/src/testing.rs b/crates/ruff_db/src/testing.rs index 1ecbeb2c6c993..1ed58f1977c23 100644 --- a/crates/ruff_db/src/testing.rs +++ b/crates/ruff_db/src/testing.rs @@ -13,12 +13,12 @@ pub fn assert_function_query_was_not_run( Q: Fn(QDb, I) -> R, I: salsa::plumbing::AsId + std::fmt::Debug + Copy, { - let id = input.as_id().as_u32(); + let id = input.as_id(); let (query_name, will_execute_event) = find_will_execute_event(db, query, input, events); db.attach(|_| { if let Some(will_execute_event) = will_execute_event { - panic!("Expected query {query_name}({id}) not to have run but it did: {will_execute_event:?}\n\n{events:#?}"); + panic!("Expected query {query_name}({id:?}) not to have run but it did: {will_execute_event:?}\n\n{events:#?}"); } }); } @@ -65,7 +65,7 @@ pub fn assert_function_query_was_run( Q: Fn(QDb, I) -> R, I: salsa::plumbing::AsId + std::fmt::Debug + Copy, { - let id = input.as_id().as_u32(); + let id = input.as_id(); let (query_name, will_execute_event) = find_will_execute_event(db, query, input, events); db.attach(|_| { @@ -224,7 +224,7 @@ fn query_was_not_run() { } #[test] -#[should_panic(expected = "Expected query len(0) not to have run but it did:")] +#[should_panic(expected = "Expected query len(Id(0)) not to have run but it did:")] fn query_was_not_run_fails_if_query_was_run() { use crate::tests::TestDb; use salsa::prelude::*; @@ -287,7 +287,7 @@ fn const_query_was_not_run_fails_if_query_was_run() { } #[test] -#[should_panic(expected = "Expected query len(0) to have run but it did not:")] +#[should_panic(expected = "Expected query len(Id(0)) to have run but it did not:")] fn query_was_run_fails_if_query_was_not_run() { use crate::tests::TestDb; use salsa::prelude::*; diff --git a/crates/ty_python_semantic/src/types.rs b/crates/ty_python_semantic/src/types.rs index 49bc6875579f6..5e49f3e54d589 100644 --- a/crates/ty_python_semantic/src/types.rs +++ b/crates/ty_python_semantic/src/types.rs @@ -9026,7 +9026,7 @@ impl<'db> BoundSuperType<'db> { // Make sure that the `Type` enum does not grow unexpectedly. #[cfg(not(debug_assertions))] #[cfg(target_pointer_width = "64")] -static_assertions::assert_eq_size!(Type, [u8; 16]); +static_assertions::assert_eq_size!(Type, [u8; 24]); #[cfg(test)] pub(crate) mod tests { diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 6eca24519666c..23a9e50b8faf7 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -30,7 +30,7 @@ ty_python_semantic = { path = "../crates/ty_python_semantic" } ty_vendored = { path = "../crates/ty_vendored" } libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer", default-features = false } -salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "4818b15f3b7516555d39f5a41cb75970448bee4c" } +salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "40d7844a7a7449a136e0946920a678b55a82f30b" } similar = { version = "2.5.0" } tracing = { version = "0.1.40" }