forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#86251 - Smittyvb:thir-tree-again, r=oli-obk
Support -Z unpretty=thir-tree again Currently `-Z unpretty=thir-tree` is broken after some THIR refactorings. This re-implements it, making it easier to debug THIR-related issues. We have to do analyzes before getting the THIR, since trying to create THIR from invalid HIR can ICE. But doing those analyzes requires the THIR to be built and stolen. We work around this by creating a separate query to construct the THIR tree string representation. Closes rust-lang/project-thir-unsafeck#8, fixes rust-lang#85552.
- Loading branch information
Showing
8 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// compile-flags: -Z unpretty=thir-tree | ||
// check-pass | ||
|
||
pub fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
DefId(0:3 ~ thir_tree[348d]::main): | ||
Thir { | ||
arms: [], | ||
exprs: [ | ||
Expr { | ||
ty: (), | ||
temp_lifetime: Some( | ||
Node(2), | ||
), | ||
span: $DIR/thir-tree.rs:4:15: 4:17 (#0), | ||
kind: Block { | ||
body: Block { | ||
targeted_by_break: false, | ||
region_scope: Node(1), | ||
opt_destruction_scope: None, | ||
span: $DIR/thir-tree.rs:4:15: 4:17 (#0), | ||
stmts: [], | ||
expr: None, | ||
safety_mode: Safe, | ||
}, | ||
}, | ||
}, | ||
Expr { | ||
ty: (), | ||
temp_lifetime: Some( | ||
Node(2), | ||
), | ||
span: $DIR/thir-tree.rs:4:15: 4:17 (#0), | ||
kind: Scope { | ||
region_scope: Node(2), | ||
lint_level: Explicit( | ||
HirId { | ||
owner: DefId(0:3 ~ thir_tree[348d]::main), | ||
local_id: 2, | ||
}, | ||
), | ||
value: e0, | ||
}, | ||
}, | ||
Expr { | ||
ty: (), | ||
temp_lifetime: Some( | ||
Node(2), | ||
), | ||
span: $DIR/thir-tree.rs:4:15: 4:17 (#0), | ||
kind: Scope { | ||
region_scope: Destruction(2), | ||
lint_level: Inherited, | ||
value: e1, | ||
}, | ||
}, | ||
], | ||
stmts: [], | ||
} | ||
|