Skip to content

Commit

Permalink
Auto merge of #109611 - Zoxc:query-engine-rem, r=cjgillot
Browse files Browse the repository at this point in the history
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 rust-lang/rust#107802 is included which avoids the double indirection. For rust-lang/rust#108938 we can name entry point `__rust_end_short_backtrace` to avoid some overhead. For rust-lang/rust#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`
  • Loading branch information
bors committed Apr 29, 2023
2 parents a11f328 + 581615d commit 8320c23
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 8320c23

Please sign in to comment.