mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Cleanup cfg check handling in expression store lowering
This commit is contained in:
parent
7d9b839f9c
commit
d11dbf648f
17 changed files with 234 additions and 188 deletions
|
|
@ -182,10 +182,8 @@ fn with_extra_thread(
|
|||
thread_intent: stdx::thread::ThreadIntent,
|
||||
f: impl FnOnce() -> anyhow::Result<()> + Send + 'static,
|
||||
) -> anyhow::Result<()> {
|
||||
let handle = stdx::thread::Builder::new(thread_intent)
|
||||
.name(thread_name.into())
|
||||
.stack_size(STACK_SIZE)
|
||||
.spawn(f)?;
|
||||
let handle =
|
||||
stdx::thread::Builder::new(thread_intent, thread_name).stack_size(STACK_SIZE).spawn(f)?;
|
||||
|
||||
handle.join()?;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,11 +15,13 @@ impl flags::Diagnostics {
|
|||
pub fn run(self) -> anyhow::Result<()> {
|
||||
const STACK_SIZE: usize = 1024 * 1024 * 8;
|
||||
|
||||
let handle = stdx::thread::Builder::new(stdx::thread::ThreadIntent::LatencySensitive)
|
||||
.name("BIG_STACK_THREAD".into())
|
||||
.stack_size(STACK_SIZE)
|
||||
.spawn(|| self.run_())
|
||||
.unwrap();
|
||||
let handle = stdx::thread::Builder::new(
|
||||
stdx::thread::ThreadIntent::LatencySensitive,
|
||||
"BIG_STACK_THREAD",
|
||||
)
|
||||
.stack_size(STACK_SIZE)
|
||||
.spawn(|| self.run_())
|
||||
.unwrap();
|
||||
|
||||
handle.join()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,13 @@ impl flags::UnresolvedReferences {
|
|||
pub fn run(self) -> anyhow::Result<()> {
|
||||
const STACK_SIZE: usize = 1024 * 1024 * 8;
|
||||
|
||||
let handle = stdx::thread::Builder::new(stdx::thread::ThreadIntent::LatencySensitive)
|
||||
.name("BIG_STACK_THREAD".into())
|
||||
.stack_size(STACK_SIZE)
|
||||
.spawn(|| self.run_())
|
||||
.unwrap();
|
||||
let handle = stdx::thread::Builder::new(
|
||||
stdx::thread::ThreadIntent::LatencySensitive,
|
||||
"BIG_STACK_THREAD",
|
||||
)
|
||||
.stack_size(STACK_SIZE)
|
||||
.spawn(|| self.run_())
|
||||
.unwrap();
|
||||
|
||||
handle.join()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,10 +148,10 @@ impl<T: Sized + Send + 'static> CommandHandle<T> {
|
|||
let stderr = child.0.stderr().take().unwrap();
|
||||
|
||||
let actor = CargoActor::<T>::new(parser, sender, stdout, stderr);
|
||||
let thread = stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker)
|
||||
.name("CommandHandle".to_owned())
|
||||
.spawn(move || actor.run())
|
||||
.expect("failed to spawn thread");
|
||||
let thread =
|
||||
stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker, "CommandHandle")
|
||||
.spawn(move || actor.run())
|
||||
.expect("failed to spawn thread");
|
||||
Ok(CommandHandle { program, arguments, current_dir, child, thread, _phantom: PhantomData })
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,10 +133,10 @@ impl FlycheckHandle {
|
|||
let actor =
|
||||
FlycheckActor::new(id, sender, config, sysroot_root, workspace_root, manifest_path);
|
||||
let (sender, receiver) = unbounded::<StateChange>();
|
||||
let thread = stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker)
|
||||
.name("Flycheck".to_owned())
|
||||
.spawn(move || actor.run(receiver))
|
||||
.expect("failed to spawn thread");
|
||||
let thread =
|
||||
stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker, format!("Flycheck{id}"))
|
||||
.spawn(move || actor.run(receiver))
|
||||
.expect("failed to spawn thread");
|
||||
FlycheckHandle { id, sender, _thread: thread }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,8 +298,7 @@ impl Server {
|
|||
) -> Server {
|
||||
let (connection, client) = Connection::memory();
|
||||
|
||||
let _thread = stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker)
|
||||
.name("test server".to_owned())
|
||||
let _thread = stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker, "test server")
|
||||
.spawn(move || main_loop(config, connection).unwrap())
|
||||
.expect("failed to spawn a thread");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue