Open camelid opened 3 years ago
As we discussed in the meeting, we're going to show each pass of the compiler,
each intermediate representation (before & after pass), and some internal data
structures (like TyCtxt
).
However, we're going to start with just showing tokens, AST, and HIR (with no internal data structures) going through the passes of lex, parse, resolve, and macro-expand, which are actually interleaved together:
lex -> (parse <-> resolve <-> expand)
We're going to start with this example code (I modified it
slightly to use @LeSeulArtichaut's name suggestion, and to change String
to
&str
, which is more idiomatic and will let us show lifetimes in action):
fn is_awesome(name: &str) -> bool {
matches!(name, "Rust" | "Ferris")
}
(See the Zulip discussion for details on why we chose this example.)
- Implement (an MVP of)
-Z dump-internal-data
[@camelid]
What do you think would be a good MVP for -Z dump-internal-data
? Maybe print the type of everything in the program?
"Internal data" is very broad. Let's maybe try to make a list of all the things we would like to be able to dump?
Sounds like a good idea :)
Opened https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/-Z.20dump-internal-data for discussion about -Z dump-internal-data
(name is to-be-bikeshedded)
cc https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/planning.20meeting.202021.2E02.2E18
-Z unpretty={ast-tree,thir-tree}
[@LeSeulArtichaut]-Z dump-internal-data
[@camelid]