rust/compiler/rustc_middle/src/mir
bors f5adff6bd8 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`
2023-04-29 21:58:13 +00:00
..
interpret Remove QueryEngine trait 2023-04-26 07:46:13 +02:00
basic_blocks.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
coverage.rs Replace enum ==s with matches where it makes sense 2023-01-30 12:26:26 +00:00
generic_graph.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
generic_graphviz.rs Remove redundant graphviz escaping 2022-11-14 15:11:18 +01:00
graphviz.rs Remove WithOptconstParam. 2023-04-20 17:48:32 +00:00
mod.rs Derive Type{Foldable,Visitable} for UserTypeProjection. 2023-04-26 15:19:51 +10:00
mono.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
patch.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
pretty.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
query.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
spanview.rs Rename Abort terminator to Terminate 2023-04-06 09:34:16 +01:00
syntax.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
tcx.rs offset_of 2023-04-21 02:14:02 -07:00
terminator.rs Rename Abort terminator to Terminate 2023-04-06 09:34:16 +01:00
traversal.rs Convert manual loop into while let 2023-04-09 23:22:14 +02:00
type_foldable.rs intern offsetof fields 2023-04-21 02:14:03 -07:00
visit.rs Preserve argument indexes when inlining MIR 2023-04-11 11:07:48 +10:00