Skip to content

ICE with --pretty=expanded and async/await #53447

Closed
@Ekleog

Description

@Ekleog

In tests/tests.rs:

#![feature(async_await)]

#[test]
fn non_stupid() {
    async { true }.wait();
}

when compiling with cargo rustc --test tests -- -Zunstable-options --pretty=expanded

Along with an empty src/lib.rs and the following Cargo.toml:

cargo-features = ["edition"]

[package]
name = "test"
edition = "2018"
version = "0.1.0"

Results in:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:345:21
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::panicking::panic
  10: syntax::print::pprust::State::print_expr_outer_attr_style
  11: syntax::print::pprust::State::print_stmt
  12: syntax::print::pprust::State::print_block_maybe_unclosed
  13: syntax::print::pprust::State::print_item
  14: syntax::print::pprust::print_crate
  15: rustc_driver::pretty::print_after_hir_lowering::{{closure}}
  16: rustc_driver::pretty::print_after_hir_lowering
  17: <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::build_controller::{{closure}}
  18: rustc_driver::driver::compile_input
  19: rustc_driver::run_compiler_with_pool
  20: syntax::with_globals
  21: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  22: __rust_maybe_catch_panic
  23: rustc_driver::run
  24: rustc_driver::main
  25: std::rt::lang_start::{{closure}}
  26: std::panicking::try::do_call
  27: __rust_maybe_catch_panic
  28: std::rt::lang_start_internal
  29: main
  30: __libc_start_main
  31: <unknown>
query stack during panic:
end of query stack
error: aborting due to 8 previous errors

Some errors occurred: E0412, E0422, E0425, E0433.
For more information about an error, try `rustc --explain E0412`.

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.30.0-nightly (d767ee116 2018-08-15) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options -C debuginfo=2 -C incremental

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

error: Could not compile `test`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitA-prettyArea: Pretty printing (including `-Z unpretty`)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions