rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.01k stars 12.54k forks source link

`-Zunpretty=identified` runs too early #10671

Open huonw opened 10 years ago

huonw commented 10 years ago
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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 7 years ago

Triage; still no change

steveklabnik commented 6 years ago

Triage: no changes

jyn514 commented 3 years ago

Triage: this now prints

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

which is -256 as u32 and still pretty unhelpful.