Skip to content

-Zunpretty=identified runs too early #10671

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

Open
huonw opened this issue Nov 26, 2013 · 7 comments
Open

-Zunpretty=identified runs too early #10671

huonw opened this issue Nov 26, 2013 · 7 comments
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) C-enhancement Category: An issue proposing an enhancement or a PR with one. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Nov 26, 2013

fn main() { println!("hello world"); }

rustc -Zunpretty=identified:

fn main() { println!("hello world"); } /* block 4294967040 */ /* 4294967040 */

Clearly it's useless if the NodeIds are all NodeId::MAX_AS_U32 (4294967040 aka -256_i32 as u32) (I think it may just have to be removed in favour of -Zunpretty=expanded,identified since the NodeIds are only assigned after macro expansion, and only correspond to elements of that AST, not the pre-expansion one).

@steveklabnik
Copy link
Member

Running this on our stock Hello world gives

fn main() { println!("Hello, world"); } /* block 4294967295 */ /* 4294967295
*/

I would think that this would be okay to close, then. What do you think, @huonw ? I mean, the future of --pretty is in question too, isn't it?

@huonw
Copy link
Member Author

huonw commented Jan 20, 2015

It's still useless, that number is just (-1) as u32; these sorts of compiler-internals flags like --pretty are likely to stick around (at least as "unstable" options) for compiler hacking/debugging.

@frewsxcv
Copy link
Member

Visiting for triage: the output has not changed

coreyf@frewbook-air /tmp> cat hello-world.rs
fn main() {
    println!("Hello world!");
}
coreyf@frewbook-air /tmp> rustc -Z unstable-options --pretty identified hello-world.rs
fn main() { println!("Hello world!"); } /* block 4294967295 */ /* 4294967295
*/

@steveklabnik
Copy link
Member

steveklabnik commented Feb 7, 2017

Triage; still no change

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

Triage: no changes

@jonas-schievink jonas-schievink added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. requires-nightly This issue requires a nightly compiler in some way. labels Jan 12, 2020
@jyn514
Copy link
Member

jyn514 commented Aug 16, 2021

Triage: this now prints

fn main() { println!("Hello world!"); } /* block 4294967040 */ /* 4294967040
*/

which is -256 as u32 and still pretty unhelpful.

@fmease fmease changed the title --pretty identified runs too early -Zunpretty=identified runs too early Sep 3, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Dec 6, 2024

Triage: no changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) C-enhancement Category: An issue proposing an enhancement or a PR with one. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants