Rollup merge of #107006 - b-naber:thir-tree, r=jackh726

Output tree representation on thir-tree

The current output of `-Zunpretty=thir-tree` is really cumbersome to work with, using an actual tree representation should make it easier to see what the thir looks like.
This commit is contained in:
Matthias Krüger 2023-01-29 20:03:37 +01:00 committed by GitHub
commit 45446824e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1345 additions and 9 deletions

View file

@ -361,6 +361,13 @@ rustc_queries! {
desc { |tcx| "constructing THIR tree for `{}`", tcx.def_path_str(key.did.to_def_id()) }
}
/// Create a list-like THIR representation for debugging.
query thir_flat(key: ty::WithOptConstParam<LocalDefId>) -> String {
no_hash
arena_cache
desc { |tcx| "constructing flat THIR representation for `{}`", tcx.def_path_str(key.did.to_def_id()) }
}
/// Set of all the `DefId`s in this crate that have MIR associated with
/// them. This includes all the body owners, but also things like struct
/// constructors.