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

error: internal compiler error: broken MIR in DefId ... #61910

rajivr opened this issue Jun 17, 2019 · 1 comment

error: internal compiler error: broken MIR in DefId ... #61910

rajivr opened this issue Jun 17, 2019 · 1 comment


Copy link

@rajivr rajivr commented Jun 17, 2019

I tried this code:


async fn a() {}

async fn b() {}

async fn start() {
    // ICE
    let a_boxed_fut: Box<impl std::future::Future> = Box::new(a());

    // NO ICE
    // let a_boxed_fut = Box::new(a());


fn main() {
    println!("Hello, world!");

This happened:

error: internal compiler error: broken MIR in DefId(0:20 ~ async_ice[a52a]::start[0]::{{closure}}[0]) (Terminator { source_info: SourceInfo { span: src/ 10:67, scope: scope[0] }, kind: _2 = const std::boxed::Box::<impl std::future::Future>::new(move _3) -> [return: bb6, unwind: bb8] }): call dest mismatch (std::boxed::Box<impl std::future::Future> <- std::boxed::Box<impl std::future::Future>): NoSolution
  --> src/
8  |   async fn start() {
   |  __________________^
9  | |     // ICE
10 | |     let a_boxed_fut: Box<impl std::future::Future> = Box::new(a());
11 | |
...  |
15 | |     b().await;
16 | | }
   | |_^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/
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:

note: rustc 1.37.0-nightly (5f3656ce9 2019-06-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

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

error: Could not compile `async-ice`.

To learn more, run the command again with --verbose.


rustc --version --verbose:

rustc 1.37.0-nightly (5f3656ce9 2019-06-11)
binary: rustc
commit-hash: 5f3656ce9a2212fad872605b7a4ee103a155e9f3
commit-date: 2019-06-11
host: x86_64-unknown-linux-gnu
release: 1.37.0-nightly
LLVM version: 8.0


stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/
   5: std::panicking::default_hook
             at src/libstd/
   6: rustc::util::common::panic_hook
   7: std::panicking::rust_panic_with_hook
             at src/libstd/
   8: std::panicking::begin_panic
   9: <rustc_errors::Handler as core::ops::drop::Drop>::drop
  10: core::ptr::real_drop_in_place
  11: core::ptr::real_drop_in_place
  12: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
  13: core::ptr::real_drop_in_place
  14: rustc_interface::interface::run_compiler_in_existing_thread_pool
  15: std::thread::local::LocalKey<T>::with
  16: scoped_tls::ScopedKey<T>::set
  17: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stack during panic:
end of query stack

This is my first encounter with a rustc bug. I asked for guidance on #wg-async-foundation discord, and I was requested to tag issue #61834 as it might be related. Also, thank you for Rust. :-)

Copy link

@cramertj cramertj commented Jun 17, 2019

I'm imagining this is a dup of #61834 and would also be closed by #61872

bors added a commit that referenced this issue Jun 26, 2019

Clean up MIR drop generation

* Don't assign twice to the destination of a `while` loop containing a `break` expression
* Use `as_temp` to evaluate statement expression
* Avoid consecutive `StorageLive`s for the condition of a `while` loop
* Unify `return`, `break` and `continue` handling, and move it to ``
* Make some of the `` internals private
* Don't use `Place`s that are always `Local`s in MIR drop generation

Closes #42371
Closes #61579
Closes #61731
Closes #61834
Closes #61910
Closes #62115
@bors bors closed this in #61872 Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants