diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-29 14:28:57 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-29 14:28:57 +0100 |
commit | 1cde354c35f425026184b8d72f4f5865e96975d4 (patch) | |
tree | 11fa53f91ff2bf598f8ba726d130708bf7b3bad2 /crates/ra_proc_macro_srv/src/tests/utils.rs | |
parent | 12aae7771dc220a62d1323ac6a30ddf215fe2b92 (diff) | |
parent | bfce6573772ebb91a9b1054864c0f53669ceee2f (diff) |
Merge #4119
4119: Cache proc-macro dlls r=matklad a=edwin0cheng
This PR try to fix a deadlock in proc-macro srv by not unloading dlls.
Currently we load and unload dlls for each request, however rustc TLS is leaky , such that if we do it a lot of times, all TLS index will be consumed and it will be deadlocked inside panic (it is because panic itself is using TLS too).
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_proc_macro_srv/src/tests/utils.rs')
-rw-r--r-- | crates/ra_proc_macro_srv/src/tests/utils.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_proc_macro_srv/src/tests/utils.rs b/crates/ra_proc_macro_srv/src/tests/utils.rs index 2139ec7a4..646a427c5 100644 --- a/crates/ra_proc_macro_srv/src/tests/utils.rs +++ b/crates/ra_proc_macro_srv/src/tests/utils.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! utils used in proc-macro tests | 1 | //! utils used in proc-macro tests |
2 | 2 | ||
3 | use crate::dylib; | 3 | use crate::dylib; |
4 | use crate::list_macros; | 4 | use crate::ProcMacroSrv; |
5 | pub use difference::Changeset as __Changeset; | 5 | pub use difference::Changeset as __Changeset; |
6 | use ra_proc_macro::ListMacrosTask; | 6 | use ra_proc_macro::ListMacrosTask; |
7 | use std::str::FromStr; | 7 | use std::str::FromStr; |
@@ -59,7 +59,7 @@ pub fn assert_expand( | |||
59 | pub fn list(crate_name: &str, version: &str) -> Vec<String> { | 59 | pub fn list(crate_name: &str, version: &str) -> Vec<String> { |
60 | let path = fixtures::dylib_path(crate_name, version); | 60 | let path = fixtures::dylib_path(crate_name, version); |
61 | let task = ListMacrosTask { lib: path }; | 61 | let task = ListMacrosTask { lib: path }; |
62 | 62 | let mut srv = ProcMacroSrv::default(); | |
63 | let res = list_macros(&task); | 63 | let res = srv.list_macros(&task).unwrap(); |
64 | res.macros.into_iter().map(|(name, kind)| format!("{} [{:?}]", name, kind)).collect() | 64 | res.macros.into_iter().map(|(name, kind)| format!("{} [{:?}]", name, kind)).collect() |
65 | } | 65 | } |