Skip to content

Dump the AST without converting to JSON #37873

Closed
@spinda

Description

@spinda

Like #10485, but using Rust's pretty-printed debug output ({:#?}) instead of a JSON encoding. This would be much easier for a human to read when trying to visualize how rustc interprets a particular syntax element (like I am right now). It could also be easily added to play.rust-lang.org as an additional output target, alongside the current ASM, LLVM IR, and MIR options. The output format wouldn't need to be stable or standardized, this would just be a debugging tool.

I imagine this would entail two additional -Z options, ast and ast-noexpand, to match ast-json and ast-json-noexpand. Am up for preparing a PR if one would be welcomed, implementation appears straightforward at first glance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions