Skip to content

Add --unpretty=mir to rustc --help -v #36473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bluss opened this issue Sep 14, 2016 · 10 comments · Fixed by #83491
Closed

Add --unpretty=mir to rustc --help -v #36473

bluss opened this issue Sep 14, 2016 · 10 comments · Fixed by #83491
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@bluss
Copy link
Member

bluss commented Sep 14, 2016

Add --unpretty=mir to rustc --help -v

It's hidden from the help output.

@nagisa
Copy link
Member

nagisa commented Sep 14, 2016

We have multiple ways to output MIR, but I think -Z dump-mir is the preferred one (also outputs the most information). Should we go ahead and remove the rest cc @rust-lang/compiler?

@eddyb
Copy link
Member

eddyb commented Sep 14, 2016

@nagisa -Z dump-mir is useless if I want to print out the whole crate's MIR at once.
Plus, it makes a complete mess of my working directory.

OTOH, we should probably move --unpretty and the unstable --pretty forms (are there any left?) to -Z, it's really annoying to type -Z unstable-options when you need any of them.

@nagisa
Copy link
Member

nagisa commented Sep 14, 2016

We could expand dump-mir with various way to dump MIR (including the whole-crate dump). I myself prefer graphviz, for example, but there’s no way to dump_mir+graphviz currently.

@nikomatsakis
Copy link
Contributor

I do dump-mir='' to dump the whole crate at once. The one thing it lacks is
graphviz output which is sometimes nice.

On Sep 14, 2016 11:36 AM, "Simonas Kazlauskas" [email protected]
wrote:

We could expand dump-mir with various way to dump MIR (including the
whole-crate dump). I myself prefer graphviz, for example, but there’s no
way to dump_mir+graphviz currently for example.


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
#36473 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJeZqATHl8FRzmB0m1aa9IAnSMzhUorks5qqBRhgaJpZM4J8nd9
.

@eddyb
Copy link
Member

eddyb commented Sep 15, 2016

@nikomatsakis Does that result in one single file? I mostly use --unpretty=mir together with a pager and sometimes jump around functions.

@nikomatsakis
Copy link
Contributor

@eddyb no it has multiple files (which I prefer, but YMMV)

@Mark-Simulacrum
Copy link
Member

We have --emit=mir today; does that fit the bill?

@Mark-Simulacrum Mark-Simulacrum added the A-frontend Area: Compiler frontend (errors, parsing and HIR) label May 13, 2017
@RalfJung
Copy link
Member

Having output to stdout (like --unpretty does) is sometimes much more useful than having it in files (even more so since the files have names that don't say anything about which function they contain).

@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 26, 2017
@jyn514
Copy link
Member

jyn514 commented Mar 25, 2021

--unpretty is now an unstable -Z option and shows up in -Z help:

    -Z                       unpretty=val -- present the input source, unstable (and less-pretty) variants;
        valid types are any of the types for `--pretty`, as well as:
        `expanded`, `expanded,identified`,
        `expanded,hygiene` (with internal representations),
        `everybody_loops` (all function bodies replaced with `loop {}`),
        `ast-tree` (raw AST before expansion),
        `ast-tree,expanded` (raw AST after expansion),
        `hir` (the HIR), `hir,identified`,
        `hir,typed` (HIR with types for each node),
        `hir-tree` (dump the raw HIR),
        `mir` (the MIR), or `mir-cfg` (graphviz formatted MIR)

So I think this can be closed; --help -v doesn't show any other unstable options and I don't think unpretty should be special.

@jyn514 jyn514 closed this as completed Mar 25, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 25, 2021

Oh hmm, --pretty is missing though. Does pretty do anything --unpretty doesn't? It seems weird to have both.

$ rustc --pretty=x -Z unstable-options
error: argument to `pretty` must be one of `normal`, `expanded`, `identified`, or `expanded,identified`; got x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants