Skip to content

An ICE when awaiting an async method. #65033

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
alexander-irbis opened this issue Oct 2, 2019 · 4 comments
Closed

An ICE when awaiting an async method. #65033

alexander-irbis opened this issue Oct 2, 2019 · 4 comments

Comments

@alexander-irbis
Copy link

alexander-irbis commented Oct 2, 2019

I tried this code:

struct Struct;

async fn a() {
    Struct.method().await;
}

impl Struct {
    async fn method(&self) {}
}

Meta

rustc --version --verbose:

rustc 1.40.0-nightly (702b45e40 2019-10-01)
binary: rustc
commit-hash: 702b45e409495a41afcccbe87a251a692b0cefab
commit-date: 2019-10-01
host: x86_64-unknown-linux-gnu
release: 1.40.0-nightly
LLVM version: 9.0

Backtrace:

error: internal compiler error: src/librustc/ich/impls_ty.rs:100: StableHasher: unexpected region '_#0r

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:912:9
stack backtrace:
   0:     0x7f46f5226a94 - backtrace::backtrace::libunwind::trace::had03042f494c8644
                               at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x7f46f5226a94 - backtrace::backtrace::trace_unsynchronized::hd39f9d891e720cba
                               at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x7f46f5226a94 - std::sys_common::backtrace::_print_fmt::h8d6b284dfbc8b472
                               at src/libstd/sys_common/backtrace.rs:76
   3:     0x7f46f5226a94 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8806bcd90aa96483
                               at src/libstd/sys_common/backtrace.rs:60
   4:     0x7f46f525ed2c - core::fmt::write::haee88c523cc35722
                               at src/libcore/fmt/mod.rs:1028
   5:     0x7f46f521ad47 - std::io::Write::write_fmt::h0798539885945dab
                               at src/libstd/io/mod.rs:1412
   6:     0x7f46f522b2c5 - std::sys_common::backtrace::_print::hf0541a24911bd57a
                               at src/libstd/sys_common/backtrace.rs:64
   7:     0x7f46f522b2c5 - std::sys_common::backtrace::print::hd75f88ea74ac2b68
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f46f522b2c5 - std::panicking::default_hook::{{closure}}::h6adea6f6a6f5a43d
                               at src/libstd/panicking.rs:196
   9:     0x7f46f522afb6 - std::panicking::default_hook::h545f35d4eeb3fe04
                               at src/libstd/panicking.rs:210
  10:     0x7f46f575e1e3 - rustc_driver::report_ice::h68f7be49f6e5e1f6
  11:     0x7f46f522baac - std::panicking::rust_panic_with_hook::h65cd03c1b89a2b1f
                               at src/libstd/panicking.rs:477
  12:     0x7f46f752033d - std::panicking::begin_panic::h148ebbaf0c69d876
  13:     0x7f46f751f663 - rustc_errors::HandlerInner::bug::h916f0f6cc4353c66
  14:     0x7f46f751e36a - rustc_errors::Handler::bug::hd5a65897f9b2f47a
  15:     0x7f46f6db75a3 - rustc::util::bug::opt_span_bug_fmt::{{closure}}::hd033ec28ac7c388e
  16:     0x7f46f6db2953 - rustc::ty::context::tls::with_opt::{{closure}}::hc4299dff220043eb
  17:     0x7f46f6db28c3 - rustc::ty::context::tls::with_context_opt::h02328606cfb95453
  18:     0x7f46f6db2907 - rustc::ty::context::tls::with_opt::hb278aedde66d2a9e
  19:     0x7f46f6db74b8 - rustc::util::bug::opt_span_bug_fmt::h5183d89fe1d09bec
  20:     0x7f46f6db7422 - rustc::util::bug::bug_fmt::h549b51465922b427
  21:     0x7f46f6a22261 - rustc::ich::impls_ty::<impl rustc_data_structures::stable_hasher::HashStable<rustc::ich::hcx::StableHashingContext> for rustc::ty::sty::RegionKind>::hash_stable::h61d8991822485626
  22:     0x7f46f6a79995 - rustc::ty::sty::_DERIVE_rustc_data_structures_stable_hasher_HashStable_rustc_ich_StableHashingContext_ctx_FOR_TyKind::<impl rustc_data_structures::stable_hasher::HashStable<rustc::ich::hcx::StableHashingContext> for rustc::ty::sty::TyKind>::hash_stable::h049fa5a5303b0a7e
  23:     0x7f46f6fa0610 - <rustc::ty::context::TypeckTables as rustc_data_structures::stable_hasher::HashStable<rustc::ich::hcx::StableHashingContext>>::hash_stable::h43c8a90a2e61d445
  24:     0x7f46f6b25820 - rustc::dep_graph::graph::DepGraph::with_task_impl::h2da78f566097c13a
  25:     0x7f46f6f2c284 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::force_query::h3dbc7d05e86ca9f1
  26:     0x7f46f6ca2065 - rustc::ty::query::plumbing::force_from_dep_node::h4fb00bd0ad2069bb
  27:     0x7f46f6b578d2 - rustc::dep_graph::graph::DepGraph::try_mark_previous_green::h6231e5ae0cf8b7b3
  28:     0x7f46f6b57641 - rustc::dep_graph::graph::DepGraph::try_mark_green::h5e99591827c9dbd4
  29:     0x7f46f6b574bd - rustc::dep_graph::graph::DepGraph::try_mark_green_and_read::h1346b3e838330b04
  30:     0x7f46f5e39653 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::he405004a72992996
  31:     0x7f46f5e8c067 - rustc_typeck::collect::checked_type_of::hdd2ba3d6284d75ea
  32:     0x7f46f5e8b4dc - rustc_typeck::collect::type_of::hafe7c584e522e55a
  33:     0x7f46f5d35937 - rustc::ty::query::__query_compute::type_of::hd9dc283b7d2b6be9
  34:     0x7f46f5dc528b - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::type_of>::compute::h6106bdf394782417
  35:     0x7f46f5d60312 - rustc::dep_graph::graph::DepGraph::with_task_impl::h65628dabebbb7c6a
  36:     0x7f46f5dedd74 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h33a75439b6805bb2
  37:     0x7f46f5ea8120 - rustc::hir::intravisit::walk_expr::h6920361f4425b4f6
  38:     0x7f46f5e749ac - rustc::hir::intravisit::Visitor::visit_fn::h1c5d9f7d2f471be7
  39:     0x7f46f5eb0489 - rustc::hir::intravisit::walk_item::hf39ce7630b9e3d63
  40:     0x7f46f5e86d19 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item::hfe12d494f35316fd
  41:     0x7f46f5d37a43 - rustc::hir::map::Map::visit_item_likes_in_module::hba5f38ec0e05070e
  42:     0x7f46f5e869d4 - rustc_typeck::collect::collect_mod_item_types::h783652871f14e2e2
  43:     0x7f46f5d34cca - rustc::ty::query::__query_compute::collect_mod_item_types::hee213b41a29724c3
  44:     0x7f46f5dc579b - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute::h4534d8e55b53974c
  45:     0x7f46f5d66b57 - rustc::dep_graph::graph::DepGraph::with_task_impl::hadf057c78c1a9b53
  46:     0x7f46f5e2e478 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hc1f255a1cf46696d
  47:     0x7f46f5d2562d - rustc_typeck::check_crate::{{closure}}::{{closure}}::h85b1650c88d729c9
  48:     0x7f46f5d12016 - rustc::util::common::time::h55a3cb50f5acd537
  49:     0x7f46f5f08f4c - rustc_typeck::check_crate::h7be3c3e662c2f2d9
  50:     0x7f46f580649b - rustc_interface::passes::analysis::h10071ba42f18f403
  51:     0x7f46f5797911 - rustc::ty::query::__query_compute::analysis::h9c9ed72fec7a997c
  52:     0x7f46f579a719 - rustc::dep_graph::graph::DepGraph::with_task_impl::haed79efb3def6336
  53:     0x7f46f570bc6e - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h37f5ada4574d18d1
  54:     0x7f46f572c04a - rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::hffa7e2c7a382ebdd
  55:     0x7f46f584ac8a - rustc_interface::passes::create_global_ctxt::{{closure}}::he94f8003fc21be1d
  56:     0x7f46f572d2eb - rustc_interface::interface::run_compiler_in_existing_thread_pool::h65d25e5617ce4f73
  57:     0x7f46f5762b91 - std::thread::local::LocalKey<T>::with::h352f48fc14e5c295
  58:     0x7f46f5750abe - scoped_tls::ScopedKey<T>::set::h530ce64abc5e2664
  59:     0x7f46f577d854 - syntax::with_globals::h7d5f6c8de2d5350f
  60:     0x7f46f579304b - std::sys_common::backtrace::__rust_begin_short_backtrace::h3cc5d3af304d06d6
  61:     0x7f46f523c17a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  62:     0x7f46f571eb19 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h6273c41643c40735
  63:     0x7f46f520d1ff - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hbe84daa506d8d611
                               at /rustc/702b45e409495a41afcccbe87a251a692b0cefab/src/liballoc/boxed.rs:922
  64:     0x7f46f523ae20 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hb7f5a408eff2d3dc
                               at /rustc/702b45e409495a41afcccbe87a251a692b0cefab/src/liballoc/boxed.rs:922
  65:     0x7f46f523ae20 - std::sys_common::thread::start_thread::h3030fc30ebd408d4
                               at src/libstd/sys_common/thread.rs:13
  66:     0x7f46f523ae20 - std::sys::unix::thread::Thread::new::thread_start::hdfeaa32dd720a1d4
                               at src/libstd/sys/unix/thread.rs:79
  67:     0x7f46f516b458 - start_thread
  68:     0x7f46f50876ef - __clone
  69:                0x0 - <unknown>

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.40.0-nightly (702b45e40 2019-10-01) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [typeck_tables_of] processing `a`
#1 [typeck_tables_of] processing `a::{{closure}}#0`
#2 [type_of] processing `a::{{closure}}#0`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
@sinkuu
Copy link
Contributor

sinkuu commented Oct 3, 2019

This seems to be #64964. Are you hitting the same bug! ("StableHasher: unexpected region")?

@alexander-irbis
Copy link
Author

@sinkuu Huh, I lost this line while copy-pasting the backtrace.

@dtolnay
Copy link
Member

dtolnay commented Oct 3, 2019

Closing as a duplicate of #64964. I believe this is already fixed in nightly-2019-10-03.

@dtolnay dtolnay closed this as completed Oct 3, 2019
@alexander-irbis
Copy link
Author

alexander-irbis commented Oct 3, 2019

Yes, I checked now with 2019-10-02. It is fixed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants