Compare commits

...

1 Commits

Author SHA1 Message Date
Micha Reiser
b46f75956f [red-knot] Add test case for read on tracked struct being initialized 2025-04-24 12:01:28 +02:00
5 changed files with 35 additions and 26 deletions

32
Cargo.lock generated
View File

@@ -490,20 +490,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "compact_str"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32"
dependencies = [
"castaway",
"cfg-if",
"itoa",
"rustversion",
"ryu",
"static_assertions",
]
[[package]]
name = "compact_str"
version = "0.9.0"
@@ -2572,7 +2558,7 @@ dependencies = [
"anyhow",
"bitflags 2.9.0",
"camino",
"compact_str 0.9.0",
"compact_str",
"countme",
"dir-test",
"drop_bomb",
@@ -2661,6 +2647,7 @@ dependencies = [
"tempfile",
"thiserror 2.0.12",
"toml",
"tracing",
]
[[package]]
@@ -3101,7 +3088,7 @@ version = "0.0.0"
dependencies = [
"aho-corasick",
"bitflags 2.9.0",
"compact_str 0.9.0",
"compact_str",
"is-macro",
"itertools 0.14.0",
"memchr",
@@ -3199,7 +3186,7 @@ dependencies = [
"anyhow",
"bitflags 2.9.0",
"bstr",
"compact_str 0.9.0",
"compact_str",
"insta",
"memchr",
"ruff_annotate_snippets",
@@ -3457,11 +3444,10 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "salsa"
version = "0.19.0"
source = "git+https://github.com/salsa-rs/salsa.git?rev=87bf6b6c2d5f6479741271da73bd9d30c2580c26#87bf6b6c2d5f6479741271da73bd9d30c2580c26"
version = "0.20.0"
dependencies = [
"boxcar",
"compact_str 0.8.1",
"compact_str",
"crossbeam-queue",
"dashmap 6.1.0",
"hashbrown 0.15.2",
@@ -3480,13 +3466,11 @@ dependencies = [
[[package]]
name = "salsa-macro-rules"
version = "0.19.0"
source = "git+https://github.com/salsa-rs/salsa.git?rev=87bf6b6c2d5f6479741271da73bd9d30c2580c26#87bf6b6c2d5f6479741271da73bd9d30c2580c26"
version = "0.20.0"
[[package]]
name = "salsa-macros"
version = "0.19.0"
source = "git+https://github.com/salsa-rs/salsa.git?rev=87bf6b6c2d5f6479741271da73bd9d30c2580c26#87bf6b6c2d5f6479741271da73bd9d30c2580c26"
version = "0.20.0"
dependencies = [
"heck",
"proc-macro2",

View File

@@ -124,7 +124,8 @@ rayon = { version = "1.10.0" }
regex = { version = "1.10.2" }
rustc-hash = { version = "2.0.0" }
# When updating salsa, make sure to also update the revision in `fuzz/Cargo.toml`
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "87bf6b6c2d5f6479741271da73bd9d30c2580c26" }
#salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "87bf6b6c2d5f6479741271da73bd9d30c2580c26" }
salsa = { path = "../salsa" }
schemars = { version = "0.8.16" }
seahash = { version = "4.1.0" }
serde = { version = "1.0.197", features = ["derive"] }

View File

@@ -0,0 +1,12 @@
# Cycle panic in tracked struct
```toml
log=true
```
## Case
```py
class Foo[T: Foo, U: (Foo, Foo)]:
pass
```

View File

@@ -34,6 +34,7 @@ serde = { workspace = true }
tempfile = { workspace = true }
toml = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
[lints]
workspace = true

View File

@@ -96,7 +96,18 @@ impl SemanticDb for Db {
#[salsa::db]
impl salsa::Database for Db {
fn salsa_event(&self, _event: &dyn Fn() -> salsa::Event) {}
fn salsa_event(&self, event: &dyn Fn() -> salsa::Event) {
if !tracing::enabled!(tracing::Level::TRACE) {
return;
}
let event = event();
if matches!(event.kind, salsa::EventKind::WillCheckCancellation) {
return;
}
tracing::trace!("Salsa event: {event:?}");
}
}
impl DbWithWritableSystem for Db {