diff options
| author | bors <bors@rust-lang.org> | 2023-04-29 21:58:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-29 21:58:13 +0000 |
| commit | f5adff6bd8b29ac7dd173b36f0c8c35bb1c593c5 (patch) | |
| tree | 0af42fdb67cd5ee8e9100915fda59e84efec4029 /compiler/rustc_interface/src/util.rs | |
| parent | 87b1f891ea76713462cfc5a15137a8fe2b24ecc2 (diff) | |
| parent | b6943736bd37e0e932089c27dd0638f0a7ddc3fe (diff) | |
| download | rust-f5adff6bd8b29ac7dd173b36f0c8c35bb1c593c5.tar.gz rust-f5adff6bd8b29ac7dd173b36f0c8c35bb1c593c5.zip | |
Auto merge of #109611 - Zoxc:query-engine-rem, r=cjgillot
Remove `QueryEngine` trait This removes the `QueryEngine` trait and `Queries` from `rustc_query_impl` and replaced them with function pointers and fields in `QuerySystem`. As a side effect `OnDiskCache` is moved back into `rustc_middle` and the `OnDiskCache` trait is also removed. This has a couple of benefits. - `TyCtxt` is used in the query system instead of the removed `QueryCtxt` which is larger. - Function pointers are more flexible to work with. A variant of https://github.com/rust-lang/rust/pull/107802 is included which avoids the double indirection. For https://github.com/rust-lang/rust/pull/108938 we can name entry point `__rust_end_short_backtrace` to avoid some overhead. For https://github.com/rust-lang/rust/pull/108062 it avoids the duplicate `QueryEngine` structs. - `QueryContext` now implements `DepContext` which avoids many `dep_context()` calls in `rustc_query_system`. - The `rustc_driver` size is reduced by 0.33%, hopefully that means some bootstrap improvements. - This avoids the unsafe code around the `QueryEngine` trait. r? `@cjgillot`
Diffstat (limited to 'compiler/rustc_interface/src/util.rs')
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index a27a1e2978a..8d37b1053d8 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -170,7 +170,8 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>( ) -> R { use rustc_data_structures::jobserver; use rustc_middle::ty::tls; - use rustc_query_impl::{deadlock, QueryContext, QueryCtxt}; + use rustc_query_impl::QueryCtxt; + use rustc_query_system::query::{deadlock, QueryContext}; let registry = sync::Registry::new(threads); let mut builder = rayon::ThreadPoolBuilder::new() @@ -182,7 +183,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>( // On deadlock, creates a new thread and forwards information in thread // locals to it. The new thread runs the deadlock handler. let query_map = tls::with(|tcx| { - QueryCtxt::from_tcx(tcx) + QueryCtxt::new(tcx) .try_collect_active_jobs() .expect("active jobs shouldn't be locked in deadlock handler") }); |
