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: 'called Option::unwrap() on a None value', compiler/rustc_middle/src/hir/map/mod.rs:180:30 #82933

Closed
PaulGrandperrin opened this issue Mar 9, 2021 · 10 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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.

Comments

@PaulGrandperrin
Copy link

I got this bug deep in the middle of trying things (abstracting some code of sqlx's Executor trait, similarly to https://github.com/eaze/tide-sqlx/blob/latest/src/lib.rs).

My codebase at this time is a big work-in-progress mess so I won't post it now, but I saved it.
The bug is reproducible, and I can give you more information if needed!

Code

use async_trait::async_trait;
#[async_trait]
trait My<'tx> {

    async fn get_conn<E>(&'tx mut self) -> api::Result<E>
    where E: Executor<'tx>;

    //#[tracing::instrument]
    pub async fn save_tmp(&self, session_id: &[u8], ip: &str, expiration: i64, field: &str, data: &[u8]) -> api::Result<()> {
        sqlx::query("replace into `tmp` values (?, INET_ATON(?), FROM_UNIXTIME(?), ?, ?)")
            .bind(session_id)
            .bind(ip)
            .bind(expiration)
            .bind(field)
            .bind(data)
            .execute(todo!()).await.map_err(|e| api::Error::ServerSideError(e.into()))?;
        Ok(())
    }

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (caca2121f 2021-03-05)
binary: rustc
commit-hash: caca2121ffe4cb47d8ea2d9469c493995f57e0b5
commit-date: 2021-03-05
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

and 

rustc 1.52.0-nightly (8f349be27 2021-03-08)
binary: rustc
commit-hash: 8f349be27815d43d462a32faeb270a22a68486b6
commit-date: 2021-03-08
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0
Backtrace

   Compiling server v0.1.0 (/home/paulg/Repositories/cachou/server)
error[E0449]: unnecessary visibility qualifier
   --> server/src/db/sql.rs:193:5
    |
193 |     pub async fn save_tmp(&self, session_id: &[u8], ip: &str, expiration: i64, field: &str, data: &[u8]) -> api::Result<()> {
    |     ^^^ `pub` not permitted here because it's implied

error[E0706]: functions in traits cannot be declared `async`
   --> server/src/db/sql.rs:193:5
    |
193 |       pub async fn save_tmp(&self, session_id: &[u8], ip: &str, expiration: i64, field: &str, data: &[u8]) -> api::Result<()> {
    |       ^   ----- `async` because of this
    |  _____|
    | |
194 | |         sqlx::query("replace into `tmp` values (?, INET_ATON(?), FROM_UNIXTIME(?), ?, ?)")
195 | |             .bind(session_id)
196 | |             .bind(ip)
...   |
201 | |         Ok(())
202 | |     }
    | |_____^
    |
    = note: `async` trait functions are not currently supported
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait

error[E0728]: `await` is only allowed inside `async` functions and blocks
   --> server/src/db/sql.rs:194:9
    |
143 | /     async fn init(&self) -> eyre::Result<()> {
144 | |
145 | |         let mut conn = self.pool.acquire().await?;
146 | |
...   |
182 | |         Ok(())
183 | |     }
    | |_____- this is not `async`
...
194 | /         sqlx::query("replace into `tmp` values (?, INET_ATON(?), FROM_UNIXTIME(?), ?, ?)")
195 | |             .bind(session_id)
196 | |             .bind(ip)
197 | |             .bind(expiration)
198 | |             .bind(field)
199 | |             .bind(data)
200 | |             .execute(todo!()).await.map_err(|e| api::Error::ServerSideError(e.into()))?;
    | |___________________________________^ only allowed inside `async` functions and blocks

warning: unused imports: `Database`, `MySqlDatabaseError`, `MySqlRow`, `Row`
 --> server/src/db/sql.rs:4:12
  |
4 | use sqlx::{Database, Executor, MySql, Pool, Row, Transaction, mysql::{MySqlConnectOptions, MySqlDatabaseError, MySqlPoolOptions, MySqlRow}};
  |            ^^^^^^^^                         ^^^                                            ^^^^^^^^^^^^^^^^^^                    ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/hir/map/mod.rs:180:30
stack backtrace:
   0:     0x7fc72b13a770 - std::backtrace_rs::backtrace::libunwind::trace::h9d49145f95eb5894
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fc72b13a770 - std::backtrace_rs::backtrace::trace_unsynchronized::hab1d020365bb6864
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc72b13a770 - std::sys_common::backtrace::_print_fmt::h7659588431e304bd
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fc72b13a770 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h09f4a9e3befae3c7
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fc72b1a999f - core::fmt::write::hf3fdfde304b9a088
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/fmt/mod.rs:1092:17
   5:     0x7fc72b12e262 - std::io::Write::write_fmt::h1cb850689c7116f0
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/io/mod.rs:1567:15
   6:     0x7fc72b13e5e5 - std::sys_common::backtrace::_print::hdbccd5aa093ba544
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fc72b13e5e5 - std::sys_common::backtrace::print::hc639c4f320222558
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fc72b13e5e5 - std::panicking::default_hook::{{closure}}::hdb012dd7a485bb5d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:208:50
   9:     0x7fc72b13e093 - std::panicking::default_hook::h75facbce77b6ba91
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:225:9
  10:     0x7fc72b92a60b - rustc_driver::report_ice::h145eda8e19e9807d
  11:     0x7fc71bd15b03 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6c23d2e4ab8f483a
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1560:9
  12:     0x7fc71bd813a6 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h728da46084a723a9
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7fc72b13ed50 - std::panicking::rust_panic_with_hook::hbcaa5de2cb5e22d5
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:595:17
  14:     0x7fc72b13e897 - std::panicking::begin_panic_handler::{{closure}}::h4ee6cde415c8f62d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:495:13
  15:     0x7fc72b13ac2c - std::sys_common::backtrace::__rust_end_short_backtrace::h895319f2d3f611c0
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7fc72b13e829 - rust_begin_unwind
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:493:5
  17:     0x7fc72b103bf1 - core::panicking::panic_fmt::h0123abb763a6e96f
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/panicking.rs:92:14
  18:     0x7fc72b103b3d - core::panicking::panic::hdf1b6c818ad7c6ad
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/panicking.rs:50:5
  19:     0x7fc72d6b0a01 - rustc_middle::hir::map::Map::opt_def_kind::hafda822620eb1365
  20:     0x7fc72d67c8ca - core::ops::function::FnOnce::call_once::ha6e93acf2cbf66d5
  21:     0x7fc72dc0aa84 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h3e8d961b73f17b13
  22:     0x7fc72d082594 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h8c1251b3e4ec6930
  23:     0x7fc72d064fc3 - rustc_data_structures::stack::ensure_sufficient_stack::ha3d62b34976de1df
  24:     0x7fc72d043a97 - rustc_query_system::query::plumbing::force_query_with_job::h63a2c9cadba26c29
  25:     0x7fc72d033f2a - rustc_query_system::query::plumbing::get_query_impl::hd7851a4e4a11ca8c
  26:     0x7fc72d09624a - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::opt_def_kind::h1c7798a4f1203a90
  27:     0x7fc72d623caf - rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::def_kind::h725580705949d783
  28:     0x7fc72d6247cb - rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::closure_base_def_id::h55fefefa98815df0
  29:     0x7fc72ce4ed64 - rustc_typeck::collect::generics_of::hbaa5ecc414a7b6ee
  30:     0x7fc72d05fb9e - rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::generics_of>::compute::h53e9738fd6e04c0f
  31:     0x7fc72dc0cbad - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h7734ae808dfd2b1f
  32:     0x7fc72d07b57e - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h2f8f9c27ddc113c0
  33:     0x7fc72d065bd9 - rustc_data_structures::stack::ensure_sufficient_stack::hcb0ec9cd528c2c92
  34:     0x7fc72d044d1b - rustc_query_system::query::plumbing::force_query_with_job::h80203c9c6301daea
  35:     0x7fc72d025756 - rustc_query_system::query::plumbing::get_query_impl::h93d23d247fa9c131
  36:     0x7fc72d09474a - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::generics_of::hbadaad9dd8178fc5
  37:     0x7fc72ce44cbe - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  38:     0x7fc72cea1172 - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  39:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  40:     0x7fc72cea1020 - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  41:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  42:     0x7fc72cea12df - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  43:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  44:     0x7fc72cea10d4 - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  45:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  46:     0x7fc72ce3d096 - rustc_hir::intravisit::Visitor::visit_fn::h13ad62dec6883570
  47:     0x7fc72d9a7fd4 - rustc_hir::intravisit::walk_trait_item::hd7f5817240d04681
  48:     0x7fc72d96c73c - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_trait_item::h01579ea4a7d275a6
  49:     0x7fc72cf04b54 - rustc_middle::hir::map::Map::visit_item_likes_in_module::hf1f9b0c19dec508a
  50:     0x7fc72d96c282 - rustc_typeck::collect::collect_mod_item_types::h4c6c601c7a830c4a
  51:     0x7fc72dc0cfec - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hf27dc1d12df476b2
  52:     0x7fc72d08b1e5 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hdb95f658b542409d
  53:     0x7fc72d04212a - rustc_query_system::query::plumbing::force_query_with_job::h4c52be323d39e9f0
  54:     0x7fc72d008625 - rustc_query_system::query::plumbing::get_query_impl::h09e0234b5dfa0a64
  55:     0x7fc72dbe8d9d - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_mod_item_types::hfcd9ce771df7f053
  56:     0x7fc72d9851f8 - rustc_session::session::Session::track_errors::hb7f18a2ce241ade8
  57:     0x7fc72d993b5d - rustc_typeck::check_crate::hb45798a7e0750d96
  58:     0x7fc72d74312d - rustc_interface::passes::analysis::hd5fe835385e08ea4
  59:     0x7fc72c1d359a - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h50860e98524c58f8
  60:     0x7fc72dbd6b1f - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hfd00dbfef9f9a682
  61:     0x7fc72db64def - rustc_data_structures::stack::ensure_sufficient_stack::hd7a6d9b50e0732ee
  62:     0x7fc72db1960a - rustc_query_system::query::plumbing::force_query_with_job::h58ca0ad33aa46c52
  63:     0x7fc72dad9cf7 - rustc_query_system::query::plumbing::get_query_impl::h780f7dedb80f697d
  64:     0x7fc72dbe719f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::h13dc424597503be6
  65:     0x7fc72d730b70 - rustc_interface::passes::QueryContext::enter::he9f1f78721fc19be
  66:     0x7fc72d702959 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::ha910cdf2670f60b6
  67:     0x7fc72d701457 - rustc_span::with_source_map::h2a3ca90867f6d1ab
  68:     0x7fc72d703a7a - rustc_interface::interface::create_compiler_and_run::heaeed074d1e7ef7f
  69:     0x7fc72d701aee - rustc_span::with_session_globals::h9988c0797bfd90f5
  70:     0x7fc72d703dee - std::sys_common::backtrace::__rust_begin_short_backtrace::hb4c4fdcf10c214f1
  71:     0x7fc72d71ef25 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb042bbb82c7cd30b
  72:     0x7fc72b14e83a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdc51fe7e73bc86bf
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/alloc/src/boxed.rs:1546:9
  73:     0x7fc72b14e83a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he605738a76b56d9d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/alloc/src/boxed.rs:1546:9
  74:     0x7fc72b14e83a - std::sys::unix::thread::Thread::new::thread_start::he44b12fd83e74919
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys/unix/thread.rs:71:17
  75:     0x7fc72b06d609 - start_thread
  76:     0x7fc72af81293 - clone
  77:                0x0 - <unknown>

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 (caca2121f 2021-03-05) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/hir/map/mod.rs:180:30
stack backtrace:
   0:     0x7fc72b13a770 - std::backtrace_rs::backtrace::libunwind::trace::h9d49145f95eb5894
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fc72b13a770 - std::backtrace_rs::backtrace::trace_unsynchronized::hab1d020365bb6864
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc72b13a770 - std::sys_common::backtrace::_print_fmt::h7659588431e304bd
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fc72b13a770 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h09f4a9e3befae3c7
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fc72b1a999f - core::fmt::write::hf3fdfde304b9a088
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/fmt/mod.rs:1092:17
   5:     0x7fc72b12e262 - std::io::Write::write_fmt::h1cb850689c7116f0
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/io/mod.rs:1567:15
   6:     0x7fc72b13e5e5 - std::sys_common::backtrace::_print::hdbccd5aa093ba544
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fc72b13e5e5 - std::sys_common::backtrace::print::hc639c4f320222558
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fc72b13e5e5 - std::panicking::default_hook::{{closure}}::hdb012dd7a485bb5d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:208:50
   9:     0x7fc72b13e093 - std::panicking::default_hook::h75facbce77b6ba91
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:225:9
  10:     0x7fc72b92a60b - rustc_driver::report_ice::h145eda8e19e9807d
  11:     0x7fc71bd15b03 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6c23d2e4ab8f483a
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1560:9
  12:     0x7fc71bd813a6 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h728da46084a723a9
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7fc72b13ed50 - std::panicking::rust_panic_with_hook::hbcaa5de2cb5e22d5
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:595:17
  14:     0x7fc72b13e897 - std::panicking::begin_panic_handler::{{closure}}::h4ee6cde415c8f62d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:495:13
  15:     0x7fc72b13ac2c - std::sys_common::backtrace::__rust_end_short_backtrace::h895319f2d3f611c0
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7fc72b13e829 - rust_begin_unwind
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:493:5
  17:     0x7fc72b103bf1 - core::panicking::panic_fmt::h0123abb763a6e96f
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/panicking.rs:92:14
  18:     0x7fc72b103b3d - core::panicking::panic::hdf1b6c818ad7c6ad
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/panicking.rs:50:5
  19:     0x7fc72d67c89e - core::ops::function::FnOnce::call_once::h338f60b781c4ae2e
  20:     0x7fc72dc10744 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hbe2c78c738199ed0
  21:     0x7fc72d07a273 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h21294d0b7e751f09
  22:     0x7fc72d064773 - rustc_data_structures::stack::ensure_sufficient_stack::h88be1ab1dd7f1603
  23:     0x7fc72d03da07 - rustc_query_system::query::plumbing::force_query_with_job::h208272bb33ea5967
  24:     0x7fc72d02b386 - rustc_query_system::query::plumbing::get_query_impl::hba5828ddc3460879
  25:     0x7fc72d09630a - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::def_span::hb0f57629852ab7b5
  26:     0x7fc72c13b9c0 - <rustc_span::def_id::DefId as rustc_query_impl::keys::Key>::default_span::h61cfcd23ec2b68bf
  27:     0x7fc72c11a223 - rustc_query_impl::make_query::opt_def_kind::hdb9f39d0052afdb9
  28:     0x7fc72bf8b09b - <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::h926cd6d01ffe2678
  29:     0x7fc72c24df16 - <hashbrown::map::HashMap<K,V,S> as core::iter::traits::collect::Extend<(K,V)>>::extend::hd3697196b488db42
  30:     0x7fc72bf63465 - rustc_query_system::query::plumbing::QueryState<D,K>::try_collect_active_jobs::h03a6d12a4dbf1b4c
  31:     0x7fc72c12c388 - rustc_query_impl::Queries::try_collect_active_jobs::h819bd1182db35356
  32:     0x7fc72c10c5c0 - <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::try_collect_active_jobs::hb36f80779a494da0
  33:     0x7fc72bf9d4ac - rustc_query_system::query::job::print_query_stack::h34679723f40d0ac7
  34:     0x7fc72ba6ed88 - rustc_interface::interface::try_print_query_stack::hc1b405579301372e
  35:     0x7fc72b92aa1c - rustc_driver::report_ice::h145eda8e19e9807d
  36:     0x7fc71bd15b03 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h6c23d2e4ab8f483a
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1560:9
  37:     0x7fc71bd813a6 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h728da46084a723a9
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:320:21
  38:     0x7fc72b13ed50 - std::panicking::rust_panic_with_hook::hbcaa5de2cb5e22d5
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:595:17
  39:     0x7fc72b13e897 - std::panicking::begin_panic_handler::{{closure}}::h4ee6cde415c8f62d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:495:13
  40:     0x7fc72b13ac2c - std::sys_common::backtrace::__rust_end_short_backtrace::h895319f2d3f611c0
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys_common/backtrace.rs:141:18
  41:     0x7fc72b13e829 - rust_begin_unwind
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/panicking.rs:493:5
  42:     0x7fc72b103bf1 - core::panicking::panic_fmt::h0123abb763a6e96f
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/panicking.rs:92:14
  43:     0x7fc72b103b3d - core::panicking::panic::hdf1b6c818ad7c6ad
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/core/src/panicking.rs:50:5
  44:     0x7fc72d6b0a01 - rustc_middle::hir::map::Map::opt_def_kind::hafda822620eb1365
  45:     0x7fc72d67c8ca - core::ops::function::FnOnce::call_once::ha6e93acf2cbf66d5
  46:     0x7fc72dc0aa84 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h3e8d961b73f17b13
  47:     0x7fc72d082594 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h8c1251b3e4ec6930
  48:     0x7fc72d064fc3 - rustc_data_structures::stack::ensure_sufficient_stack::ha3d62b34976de1df
  49:     0x7fc72d043a97 - rustc_query_system::query::plumbing::force_query_with_job::h63a2c9cadba26c29
  50:     0x7fc72d033f2a - rustc_query_system::query::plumbing::get_query_impl::hd7851a4e4a11ca8c
  51:     0x7fc72d09624a - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::opt_def_kind::h1c7798a4f1203a90
  52:     0x7fc72d623caf - rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::def_kind::h725580705949d783
  53:     0x7fc72d6247cb - rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::closure_base_def_id::h55fefefa98815df0
  54:     0x7fc72ce4ed64 - rustc_typeck::collect::generics_of::hbaa5ecc414a7b6ee
  55:     0x7fc72d05fb9e - rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::generics_of>::compute::h53e9738fd6e04c0f
  56:     0x7fc72dc0cbad - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h7734ae808dfd2b1f
  57:     0x7fc72d07b57e - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h2f8f9c27ddc113c0
  58:     0x7fc72d065bd9 - rustc_data_structures::stack::ensure_sufficient_stack::hcb0ec9cd528c2c92
  59:     0x7fc72d044d1b - rustc_query_system::query::plumbing::force_query_with_job::h80203c9c6301daea
  60:     0x7fc72d025756 - rustc_query_system::query::plumbing::get_query_impl::h93d23d247fa9c131
  61:     0x7fc72d09474a - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::generics_of::hbadaad9dd8178fc5
  62:     0x7fc72ce44cbe - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  63:     0x7fc72cea1172 - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  64:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  65:     0x7fc72cea1020 - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  66:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  67:     0x7fc72cea12df - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  68:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  69:     0x7fc72cea10d4 - rustc_hir::intravisit::walk_expr::h7fb17ba07fbae51c
  70:     0x7fc72ce44997 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h34ffc61a8728cc34
  71:     0x7fc72ce3d096 - rustc_hir::intravisit::Visitor::visit_fn::h13ad62dec6883570
  72:     0x7fc72d9a7fd4 - rustc_hir::intravisit::walk_trait_item::hd7f5817240d04681
  73:     0x7fc72d96c73c - <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_trait_item::h01579ea4a7d275a6
  74:     0x7fc72cf04b54 - rustc_middle::hir::map::Map::visit_item_likes_in_module::hf1f9b0c19dec508a
  75:     0x7fc72d96c282 - rustc_typeck::collect::collect_mod_item_types::h4c6c601c7a830c4a
  76:     0x7fc72dc0cfec - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hf27dc1d12df476b2
  77:     0x7fc72d08b1e5 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hdb95f658b542409d
  78:     0x7fc72d04212a - rustc_query_system::query::plumbing::force_query_with_job::h4c52be323d39e9f0
  79:     0x7fc72d008625 - rustc_query_system::query::plumbing::get_query_impl::h09e0234b5dfa0a64
  80:     0x7fc72dbe8d9d - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_mod_item_types::hfcd9ce771df7f053
  81:     0x7fc72d9851f8 - rustc_session::session::Session::track_errors::hb7f18a2ce241ade8
  82:     0x7fc72d993b5d - rustc_typeck::check_crate::hb45798a7e0750d96
  83:     0x7fc72d74312d - rustc_interface::passes::analysis::hd5fe835385e08ea4
  84:     0x7fc72c1d359a - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h50860e98524c58f8
  85:     0x7fc72dbd6b1f - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hfd00dbfef9f9a682
  86:     0x7fc72db64def - rustc_data_structures::stack::ensure_sufficient_stack::hd7a6d9b50e0732ee
  87:     0x7fc72db1960a - rustc_query_system::query::plumbing::force_query_with_job::h58ca0ad33aa46c52
  88:     0x7fc72dad9cf7 - rustc_query_system::query::plumbing::get_query_impl::h780f7dedb80f697d
  89:     0x7fc72dbe719f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::h13dc424597503be6
  90:     0x7fc72d730b70 - rustc_interface::passes::QueryContext::enter::he9f1f78721fc19be
  91:     0x7fc72d702959 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::ha910cdf2670f60b6
  92:     0x7fc72d701457 - rustc_span::with_source_map::h2a3ca90867f6d1ab
  93:     0x7fc72d703a7a - rustc_interface::interface::create_compiler_and_run::heaeed074d1e7ef7f
  94:     0x7fc72d701aee - rustc_span::with_session_globals::h9988c0797bfd90f5
  95:     0x7fc72d703dee - std::sys_common::backtrace::__rust_begin_short_backtrace::hb4c4fdcf10c214f1
  96:     0x7fc72d71ef25 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb042bbb82c7cd30b
  97:     0x7fc72b14e83a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdc51fe7e73bc86bf
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/alloc/src/boxed.rs:1546:9
  98:     0x7fc72b14e83a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he605738a76b56d9d
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/alloc/src/boxed.rs:1546:9
  99:     0x7fc72b14e83a - std::sys::unix::thread::Thread::new::thread_start::he44b12fd83e74919
                               at /rustc/caca2121ffe4cb47d8ea2d9469c493995f57e0b5/library/std/src/sys/unix/thread.rs:71:17
 100:     0x7fc72b06d609 - start_thread
 101:     0x7fc72af81293 - clone
 102:                0x0 - <unknown>

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 (caca2121f 2021-03-05) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
error: could not compile `server`

Caused by:
  process didn't exit successfully: `rustc --crate-name server --edition=2018 server/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="_ex-tokio"' --cfg 'feature="_rt-tokio"' --cfg 'feature="default"' --cfg 'feature="exec-tokio-rt-tokio"' --cfg 'feature="tokio"' --cfg 'feature="warp"' -C metadata=5ec5f2009c761b4b -C extra-filename=-5ec5f2009c761b4b --out-dir /home/paulg/Repositories/cachou/target/debug/deps -C incremental=/home/paulg/Repositories/cachou/target/debug/incremental -L dependency=/home/paulg/Repositories/cachou/target/debug/deps --extern async_trait=/home/paulg/Repositories/cachou/target/debug/deps/libasync_trait-e02e9614c16f9c89.so --extern bs58=/home/paulg/Repositories/cachou/target/debug/deps/libbs58-27bc91e2094a185a.rmeta --extern chrono=/home/paulg/Repositories/cachou/target/debug/deps/libchrono-3fd005d9c1dd63e3.rmeta --extern color_eyre=/home/paulg/Repositories/cachou/target/debug/deps/libcolor_eyre-fa40600726a51edd.rmeta --extern common=/home/paulg/Repositories/cachou/target/debug/deps/libcommon-162803d9b8b157ef.rmeta --extern eyre=/home/paulg/Repositories/cachou/target/debug/deps/libeyre-e4f7e4ecba40d2cd.rmeta --extern futures_util=/home/paulg/Repositories/cachou/target/debug/deps/libfutures_util-82ec6b7b4e36918c.rmeta --extern generic_array=/home/paulg/Repositories/cachou/target/debug/deps/libgeneric_array-ed380dcc5b1569b8.rmeta --extern generic_bytes=/home/paulg/Repositories/cachou/target/debug/deps/libgeneric_bytes-803be162d28ba4aa.rmeta --extern opaque_ke=/home/paulg/Repositories/cachou/target/debug/deps/libopaque_ke-cd651f45ee44fe33.rmeta --extern rand=/home/paulg/Repositories/cachou/target/debug/deps/librand-74ca103fba65f454.rmeta --extern rand_core=/home/paulg/Repositories/cachou/target/debug/deps/librand_core-81b841ef291bf850.rmeta --extern rmp_serde=/home/paulg/Repositories/cachou/target/debug/deps/librmp_serde-906dde8366ae47fb.rmeta --extern serde=/home/paulg/Repositories/cachou/target/debug/deps/libserde-bf49ce65f2481871.rmeta --extern serde_bytes=/home/paulg/Repositories/cachou/target/debug/deps/libserde_bytes-0b9dfcfcd9e146a8.rmeta --extern sqlx=/home/paulg/Repositories/cachou/target/debug/deps/libsqlx-ccf45533f10137b8.rmeta --extern structopt=/home/paulg/Repositories/cachou/target/debug/deps/libstructopt-8cabe8a5fb524fdb.rmeta --extern tokio=/home/paulg/Repositories/cachou/target/debug/deps/libtokio-5e00381d94827733.rmeta --extern toml=/home/paulg/Repositories/cachou/target/debug/deps/libtoml-e428c3f485f3ad82.rmeta --extern tracing=/home/paulg/Repositories/cachou/target/debug/deps/libtracing-c1ab0aaf4b8e3f1b.rmeta --extern tracing_subscriber=/home/paulg/Repositories/cachou/target/debug/deps/libtracing_subscriber-0f1052182e7a394c.rmeta --extern warp=/home/paulg/Repositories/cachou/target/debug/deps/libwarp-ce5bd80ef17eb12f.rmeta -L native=/home/paulg/Repositories/cachou/target/debug/build/blake3-31d5dbf40bbbb494/out -L native=/home/paulg/Repositories/cachou/target/debug/build/blake3-31d5dbf40bbbb494/out -L native=/home/paulg/Repositories/cachou/target/debug/build/ring-b40952d0b5ed9dcf/out` (signal: 4, SIGILL: illegal instruction)

@PaulGrandperrin PaulGrandperrin added C-bug Category: This is a bug. 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. labels Mar 9, 2021
@estebank estebank added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Mar 9, 2021
@PaulGrandperrin
Copy link
Author

@estebank what does mcve stands for?
Is there something I need to do to help?

@estebank
Copy link
Contributor

@PaulGrandperrin we would like to have a minimal reproducible example of the problem. Ideally it would be something that we can eventually put in the test suite to catch regressions, but if you could push out a repo that reproduces the problem, that would be enough for us to identify what is triggering the problem. The backtrace is very useful, but being able to test and verify potential solutions is necessary to be able to land any PR fixing this.

@fanninpm
Copy link

what does mcve stands for?

Minimal, Complete, and Verifiable Example

@jyn514
Copy link
Member

jyn514 commented Mar 14, 2021

thread 'rustc' panicked at 'called Option::unwrap() on a None value', compiler/rustc_middle/src/hir/map/mod.rs:180:30

self.tcx.definitions.local_def_id_to_hir_id(def_id)
#[inline]
#[track_caller]
pub fn local_def_id_to_hir_id(&self, id: LocalDefId) -> hir::HirId {
self.def_id_to_hir_id[id].unwrap()
}

Might be another case of #71104.

jyn514 added a commit to jyn514/rust that referenced this issue Mar 14, 2021
Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 15, 2021
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 15, 2021
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 15, 2021
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 15, 2021
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
@extrawurst
Copy link

I just ran into this after simply having a typo in an #![allow(..)]:

#![allow0(clippy::use_self)]

unfortunately the entire project is too large and closed-source to be a repro, but I was confused how a simple typo triggered this. I guess it was just bad luck :(

backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/hir/map/mod.rs:180:30
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: rustc_middle::hir::map::Map::opt_def_kind
   4: core::ops::function::FnOnce::call_once
   5: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_data_structures::stack::ensure_sufficient_stack
   8: rustc_query_system::query::plumbing::force_query_with_job
   9: rustc_query_system::query::plumbing::get_query_impl
  10: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::closure_base_def_id
  11: rustc_typeck::collect::generics_of
  12: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::generics_of>::compute
  13: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  14: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  15: rustc_data_structures::stack::ensure_sufficient_stack
  16: rustc_query_system::query::plumbing::force_query_with_job
  17: rustc_query_system::query::plumbing::get_query_impl
  18: rustc_query_system::query::plumbing::ensure_query_impl
  19: rustc_hir::intravisit::walk_expr
  20: rustc_hir::intravisit::walk_expr
  21: rustc_hir::intravisit::walk_expr
  22: rustc_hir::intravisit::walk_stmt
  23: rustc_hir::intravisit::walk_block
  24: rustc_hir::intravisit::walk_expr
  25: rustc_hir::intravisit::walk_stmt
  26: rustc_hir::intravisit::walk_block
  27: rustc_hir::intravisit::walk_body
  28: rustc_hir::intravisit::walk_trait_item
  29: <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_trait_item
  30: rustc_middle::hir::map::Map::visit_item_likes_in_module
  31: rustc_typeck::collect::collect_mod_item_types
  32: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::collect_mod_item_types>::compute
  33: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  34: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  35: rustc_data_structures::stack::ensure_sufficient_stack
  36: rustc_query_system::query::plumbing::force_query_with_job
  37: rustc_query_system::query::plumbing::get_query_impl
  38: rustc_query_system::query::plumbing::ensure_query_impl
  39: rustc_session::session::Session::track_errors
  40: rustc_typeck::check_crate
  41: rustc_interface::passes::analysis
  42: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  43: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  44: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  45: rustc_data_structures::stack::ensure_sufficient_stack
  46: rustc_query_system::query::plumbing::force_query_with_job
  47: rustc_query_system::query::plumbing::get_query_impl
  48: rustc_interface::passes::QueryContext::enter
  49: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  50: rustc_span::with_source_map
  51: rustc_interface::interface::create_compiler_and_run
  52: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.51.0 (2fd73fabe 2021-03-23) running on x86_64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental --crate-type bin

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

query stack during panic:
#0 [opt_def_kind] looking up definition kind of `s4module::kotd::KotdDB::count_wins::{closure#0}`
#1 [generics_of] computing generics of `s4module::kotd::KotdDB::count_wins::{closure#0}::{closure#0}`
#2 [collect_mod_item_types] collecting item types in module `s4module::kotd`
#3 [analysis] running analysis passes on this crate
end of query stack

@fanninpm
Copy link

fanninpm commented Apr 1, 2021

note: rustc 1.51.0 (2fd73fabe 2021-03-23) running on x86_64-apple-darwin

@extrawurst Are you able to get a more recent version of nightly?

@Skepfyr
Copy link
Contributor

Skepfyr commented May 22, 2021

@PaulGrandperrin Can you still reproduce this? If you can, could you provide instructions? Someone else may come along and create an MCVE.

hellow554 added a commit to hellow554/rust that referenced this issue May 25, 2021
@hellow554
Copy link
Contributor

Fixed and testcase was added in #84168, so can somebody please close this? :)

@jyn514
Copy link
Member

jyn514 commented May 26, 2021

@hellow554 that PR links to #84149, not here. Did you mean a different PR?

@hellow554
Copy link
Contributor

@jyn514 I'm very confused myself, so bear with me.

I was cleaning up my open issues, where I was stumbling upon #74318, which has a different ICE than before. Because of that I closed that issue and look up similar ones (with the same error message) and landed here.
I minimized my codebase to see what the error is and came up with #85661 but alex rightfully noticed, that the PR I was refering to didn't do anything related to this issue at all.
So I bisected the correct PR which closed the issue and it was #84168.
That PR also included a testcase for it, so my original PR could be closed and this issue as well, because a) it does not occur on nightly anymore and b) a testcase was added.

Does this make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants