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

ICE: print_if saw if with weird alternative', compiler/rustc_hir_pretty/src/lib.rs:1106:25 #83136

Closed
jyn514 opened this issue Mar 15, 2021 · 3 comments
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

@jyn514
Copy link
Member

jyn514 commented Mar 15, 2021

Code

rust-lang/rust-playground@a19bffb

Meta

rustc --version: rustc 1.52.0-nightly (3a5d45f 2021-03-09)

Error output

thread 'rustc' panicked at 'print_if saw if with weird alternative', compiler/rustc_hir_pretty/src/lib.rs:1106:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.52.0-nightly (3a5d45f68 2021-03-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unpretty=hir -C embed-bitcode=no -C debuginfo=2 -C incremental -C link-arg=-fuse-ld=lld --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `ui`
Backtrace

thread 'rustc' panicked at 'print_if saw if with weird alternative', compiler/rustc_hir_pretty/src/lib.rs:1106:25
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_hir_pretty::State::print_else
   2: rustc_hir_pretty::State::print_expr
   3: rustc_hir_pretty::State::print_block_maybe_unclosed
   4: rustc_hir_pretty::State::print_expr
   5: rustc_hir_pretty::State::print_stmt
   6: rustc_hir_pretty::State::print_block_maybe_unclosed
   7: rustc_hir_pretty::State::print_expr
   8: rustc_hir_pretty::State::print_arm
   9: rustc_hir_pretty::State::print_expr
  10: rustc_hir_pretty::State::print_expr
  11: rustc_hir_pretty::State::print_stmt
  12: rustc_hir_pretty::State::print_block_maybe_unclosed
  13: rustc_hir_pretty::State::print_expr
  14: <rustc_driver::pretty::NoAnn as rustc_hir_pretty::PpAnn>::nested
  15: rustc_hir_pretty::State::print_item
  16: <rustc_driver::pretty::NoAnn as rustc_hir_pretty::PpAnn>::nested
  17: rustc_hir_pretty::State::print_mod
  18: rustc_hir_pretty::State::print_item
  19: <rustc_driver::pretty::NoAnn as rustc_hir_pretty::PpAnn>::nested
  20: rustc_hir_pretty::State::print_mod
  21: rustc_hir_pretty::print_crate
  22: rustc_driver::pretty::print_after_hir_lowering
  23: rustc_interface::passes::QueryContext::enter
  24: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  25: rustc_span::with_source_map
  26: rustc_interface::interface::create_compiler_and_run
  27: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@jyn514 jyn514 added A-pretty Area: Pretty printing (including `-Z unpretty`) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. labels Mar 15, 2021
@jyn514
Copy link
Member Author

jyn514 commented Mar 15, 2021

// BLEAH, constraints would be great here
_ => {
panic!("print_if saw if with weird alternative");
}

@matthiaskrgr
Copy link
Member

dupe of #82329 ?
Most of the -Zunpretty flags are pretty ICEy

@jyn514
Copy link
Member Author

jyn514 commented Mar 15, 2021

dupe of #82329 ?

yup, thanks!

@jyn514 jyn514 closed this as completed Mar 15, 2021
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-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

2 participants