mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
⬆️ rust-analyzer
This commit is contained in:
parent
31519bb394
commit
3e358a6827
74 changed files with 2091 additions and 951 deletions
|
@ -26,6 +26,7 @@ use std::{
|
|||
ffi::OsString,
|
||||
fs,
|
||||
path::{Path, PathBuf},
|
||||
thread,
|
||||
time::SystemTime,
|
||||
};
|
||||
|
||||
|
@ -65,18 +66,16 @@ impl ProcMacroSrv {
|
|||
|
||||
let macro_body = task.macro_body.to_subtree();
|
||||
let attributes = task.attributes.map(|it| it.to_subtree());
|
||||
// FIXME: replace this with std's scoped threads once they stabilize
|
||||
// (then remove dependency on crossbeam)
|
||||
let result = crossbeam::scope(|s| {
|
||||
let res = match s
|
||||
.builder()
|
||||
let result = thread::scope(|s| {
|
||||
let thread = thread::Builder::new()
|
||||
.stack_size(EXPANDER_STACK_SIZE)
|
||||
.name(task.macro_name.clone())
|
||||
.spawn(|_| {
|
||||
.spawn_scoped(s, || {
|
||||
expander
|
||||
.expand(&task.macro_name, ¯o_body, attributes.as_ref())
|
||||
.map(|it| FlatTree::new(&it))
|
||||
}) {
|
||||
});
|
||||
let res = match thread {
|
||||
Ok(handle) => handle.join(),
|
||||
Err(e) => std::panic::resume_unwind(Box::new(e)),
|
||||
};
|
||||
|
@ -86,10 +85,6 @@ impl ProcMacroSrv {
|
|||
Err(e) => std::panic::resume_unwind(e),
|
||||
}
|
||||
});
|
||||
let result = match result {
|
||||
Ok(result) => result,
|
||||
Err(e) => std::panic::resume_unwind(e),
|
||||
};
|
||||
|
||||
prev_env.rollback();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue