diff options
author | Florian Diebold <[email protected]> | 2020-03-27 17:56:18 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-04-10 14:04:06 +0100 |
commit | a0a80a41034b1240dc3e8fd794ae1d4f77714d99 (patch) | |
tree | 1daf136828992006de9e21784a89b2d14be61b74 /Cargo.lock | |
parent | 176f7f61175bc433c56083a758bd7a28a8ae31f8 (diff) |
Implement Chalk's debug methods using TLS
Chalk now panics if we don't implement these methods and run with CHALK_DEBUG,
so I thought I'd try to implement them 'properly'. Sadly, it seems impossible to
do without transmuting lifetimes somewhere. The problem is that we need a `&dyn
HirDatabase` to get names etc., which we can't just put into TLS. I thought I
could just use `scoped-tls`, but that doesn't support references to unsized
types. So I put the `&dyn` into another struct and put the reference to *that*
into the TLS, but I have to transmute the lifetime to 'static for that to work.
Diffstat (limited to 'Cargo.lock')
-rw-r--r-- | Cargo.lock | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock index 34f05e83a..20e7e745b 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -995,6 +995,7 @@ dependencies = [ | |||
995 | "ra_prof", | 995 | "ra_prof", |
996 | "ra_syntax", | 996 | "ra_syntax", |
997 | "rustc-hash", | 997 | "rustc-hash", |
998 | "scoped-tls", | ||
998 | "smallvec", | 999 | "smallvec", |
999 | "stdx", | 1000 | "stdx", |
1000 | "test_utils", | 1001 | "test_utils", |
@@ -1391,6 +1392,12 @@ dependencies = [ | |||
1391 | ] | 1392 | ] |
1392 | 1393 | ||
1393 | [[package]] | 1394 | [[package]] |
1395 | name = "scoped-tls" | ||
1396 | version = "1.0.0" | ||
1397 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1398 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" | ||
1399 | |||
1400 | [[package]] | ||
1394 | name = "scopeguard" | 1401 | name = "scopeguard" |
1395 | version = "1.1.0" | 1402 | version = "1.1.0" |
1396 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1403 | source = "registry+https://github.com/rust-lang/crates.io-index" |