Skip to content
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

-Z unpretty=expanded does not emit anything when abort happens during lowering #60857

Closed
Centril opened this issue May 15, 2019 · 5 comments
Closed
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-pretty Area: Pretty printing (including `-Z unpretty`) E-help-wanted Call for participation: Help is requested to fix this issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Centril
Copy link
Contributor

Centril commented May 15, 2019

For example, say I have:

// compile-flags: -Z unpretty=expanded

fn main() {
    if true && let 0 = 1 {}
}

and then I have some abort_if_errors in HIR lowering that this will trigger.
This causes an error and no prettied output.

Meanwhile, I expect compilation to stop after dumping the prettied output.

cc @Zoxc @oli-obk

@Centril Centril added A-frontend Area: Compiler frontend (errors, parsing and HIR) A-pretty Area: Pretty printing (including `-Z unpretty`) A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-help-wanted Call for participation: Help is requested to fix this issue. labels May 15, 2019
@Mark-Simulacrum Mark-Simulacrum removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-testsuite Area: The testsuite used to check the correctness of rustc labels Jun 8, 2019
@V1shvesh
Copy link
Contributor

Hey @Centril! Can I pick up this issue?

@Centril
Copy link
Contributor Author

Centril commented Sep 10, 2019

@V1shvesh sure, go for it. :)

(I have personally not investigated how or where to fix it so you'll need to do some digging.)

@V1shvesh
Copy link
Contributor

Will do my best!

@Enselic
Copy link
Member

Enselic commented Aug 12, 2023

What is a good way to trigger

abort_if_errors in HIR lowering

? The example code aborts compilation AND prints the expanded code:

$ rustc +nightly -Z unpretty=expanded ~/src/bin/src/main.rs
error[E0658]: `let` expressions in this position are unstable
 --> /home/martin/src/bin/src/main.rs:4:16
  |
4 |     if true && let 0 = 1 {}
  |                ^^^^^^^^^
  |
  = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
  = help: add `#![feature(let_chains)]` to the crate attributes to enable

#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
// compile-flags: -Z unpretty=expanded

fn main() { if true && let 0 = 1 {} }
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
$ rustc +nightly --version
rustc 1.73.0-nightly (a6f8aa5a0 2023-08-11)

Does this mean the behavior is now as desired, and we only need to add a regression test to close this issue?

@oli-obk
Copy link
Contributor

oli-obk commented Aug 28, 2023

I think without a reproduction, we can close this issue and see if it gets reported again with a new repro

@oli-obk oli-obk closed this as completed Aug 28, 2023
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) A-pretty Area: Pretty printing (including `-Z unpretty`) E-help-wanted Call for participation: Help is requested to fix this issue. 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

5 participants