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: panicked at 'already borrowed: BorrowMutError' and thread panicked while panicking. aborting. #83479

Open
chengniansun opened this issue Mar 25, 2021 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

type PairCoupledTypes: Trait<
    [u32; {
        static FOO: usize;
    }],
> = impl Trait<
    [u32; {
        static FOO: usize;
    }],
>;

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (07e0e2ec2 2021-03-24)
binary: rustc
commit-hash: 07e0e2ec268c140e607e1ac7f49f145612d0f597
commit-date: 2021-03-24
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error: bounds on `type`s in this context have no effect
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:24
  |
1 |   type PairCoupledTypes: Trait<
  |  ________________________^
2 | |     [u32; {
3 | |         static FOO: usize;
4 | |     }],
5 | | > = impl Trait<
  | |_^

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:9
  |
3 |         static FOO: usize;
  |         ^^^^^^^^^^^^^^^^^-
  |                          |
  |                          help: provide a definition for the static: `= <expr>;`

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:7:9
  |
7 |         static FOO: usize;
  |         ^^^^^^^^^^^^^^^^^-
  |                          |
  |                          help: provide a definition for the static: `= <expr>;`

error[E0405]: cannot find trait `Trait` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:24
  |
1 | type PairCoupledTypes: Trait<
  |                        ^^^^^ not found in this scope

error[E0405]: cannot find trait `Trait` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:10
  |
5 | > = impl Trait<
  |          ^^^^^ not found in this scope

error[E0658]: `impl Trait` in type aliases is unstable
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:5
  |
5 |   > = impl Trait<
  |  _____^
6 | |     [u32; {
7 | |         static FOO: usize;
8 | |     }],
9 | | >;
  | |_^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/hir/map/collector.rs:156:78
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.53.0-nightly (07e0e2ec2 2021-03-24) running on x86_64-unknown-linux-gnu

query stack during panic:
thread 'rustc' panicked at 'already borrowed: BorrowMutError', /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/compiler/rustc_data_structures/src/sync.rs:481:16
stack backtrace:
   0:     0x7fd27e03ff80 - std::backtrace_rs::backtrace::libunwind::trace::h4dee703919bfd40a
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fd27e03ff80 - std::backtrace_rs::backtrace::trace_unsynchronized::h457e839f1a563e20
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd27e03ff80 - std::sys_common::backtrace::_print_fmt::h86a55fb30f8393c8
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fd27e03ff80 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7b3d6cac46d277e1
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fd27e0ae8df - core::fmt::write::h127419eb46f2ecc9
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/fmt/mod.rs:1092:17
   5:     0x7fd27e034505 - std::io::Write::write_fmt::h6010cfbb4726588b
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/io/mod.rs:1578:15
   6:     0x7fd27e043cbb - std::sys_common::backtrace::_print::h79b4f9652330cc9d
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fd27e043cbb - std::sys_common::backtrace::print::h330bb326a76af8cf
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fd27e043cbb - std::panicking::default_hook::{{closure}}::heb6a42a7d50a472e
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:208:50
   9:     0x7fd27e043783 - std::panicking::default_hook::h17e521ba6d68d6e1
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:225:9
  10:     0x7fd27e815f2b - rustc_driver::report_ice::ha40982d59fc75b99
  11:     0x7fd27e0443d0 - std::panicking::rust_panic_with_hook::h70db735e3a6e70cb
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:595:17
  12:     0x7fd27e043fa7 - std::panicking::begin_panic_handler::{{closure}}::h777c71c8e5a7e25c
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:497:13
  13:     0x7fd27e04043c - std::sys_common::backtrace::__rust_end_short_backtrace::h3e9bf30168899554
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7fd27e043f09 - rust_begin_unwind
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
  15:     0x7fd27e00af31 - core::panicking::panic_fmt::h5322a082d19786c3
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
  16:     0x7fd27e00ae23 - core::option::expect_none_failed::h354eaa93a51d71b8
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/option.rs:1329:5
  17:     0x7fd27fd7d6b1 - rustc_query_system::query::plumbing::get_query_impl::h9285eb59969e22c8
  18:     0x7fd27fddd43f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::hir_owner::h8cf23765d3e4de6b
  19:     0x7fd2803ebcd9 - rustc_middle::hir::map::Map::find_entry::h29d0e05ce7362da9
  20:     0x7fd2803ee781 - rustc_middle::hir::map::Map::opt_span::h0e633ec6695201db
  21:     0x7fd2803e5bb4 - core::ops::function::FnOnce::call_once::h8e8fc2e78b42ea40
  22:     0x7fd27fdf5fef - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::heb66790eab05aa9c
  23:     0x7fd27fd9edc6 - rustc_query_system::query::plumbing::force_query_with_job::hd99723bfec38226e
  24:     0x7fd27fd681aa - rustc_query_system::query::plumbing::get_query_impl::h29f54ecbf531e372
  25:     0x7fd27fddf2ca - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::def_span::hf8951f7e9bd1bf9c
  26:     0x7fd27ee23f40 - <rustc_span::def_id::DefId as rustc_query_impl::keys::Key>::default_span::h1c3c7dc090c3f014
  27:     0x7fd27ee23e68 - <rustc_span::def_id::LocalDefId as rustc_query_impl::keys::Key>::default_span::heda70f45b0543b34
  28:     0x7fd27ef9f123 - rustc_query_impl::make_query::hir_owner::h3da83ab69db93eaa
  29:     0x7fd27f03f777 - <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::hd1991837c2161eb2
  30:     0x7fd27f01bd2e - <hashbrown::map::HashMap<K,V,S,A> as core::iter::traits::collect::Extend<(K,V)>>::extend::hd6666d2b93c8a6ad
  31:     0x7fd27ed91619 - rustc_query_system::query::plumbing::QueryState<D,K>::try_collect_active_jobs::h9e1d046a9d6f2a48
  32:     0x7fd27eed6215 - rustc_query_impl::Queries::try_collect_active_jobs::hde35c82843c1c977
  33:     0x7fd27ef9de10 - <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::try_collect_active_jobs::h074fbdf881b5d394
  34:     0x7fd27edf4efc - rustc_query_system::query::job::print_query_stack::hc8bd6fa9da6896ed
  35:     0x7fd27e8e8018 - rustc_interface::interface::try_print_query_stack::h52edfe36792d8caa
  36:     0x7fd27e816338 - rustc_driver::report_ice::ha40982d59fc75b99
  37:     0x7fd27e0443d0 - std::panicking::rust_panic_with_hook::h70db735e3a6e70cb
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:595:17
  38:     0x7fd27e043f77 - std::panicking::begin_panic_handler::{{closure}}::h777c71c8e5a7e25c
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:495:13
  39:     0x7fd27e04043c - std::sys_common::backtrace::__rust_end_short_backtrace::h3e9bf30168899554
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:141:18
  40:     0x7fd27e043f09 - rust_begin_unwind
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
  41:     0x7fd27e00af31 - core::panicking::panic_fmt::h5322a082d19786c3
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
  42:     0x7fd27e00ae7d - core::panicking::panic::haebb15b6842d6229
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:50:5
  43:     0x7fd2803848f3 - rustc_middle::hir::map::collector::NodeCollector::finalize_and_compute_crate_hash::ha4f7aa4c32ef1fb5
  44:     0x7fd280d97e48 - rustc_middle::hir::map::index_hir::h8d13710fbf6ecbc7
  45:     0x7fd280909f75 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hb443d6bb581e91b6
  46:     0x7fd280966f17 - rustc_data_structures::stack::ensure_sufficient_stack::he0c6c8cfc8bd647a
  47:     0x7fd28083d5c1 - rustc_query_system::query::plumbing::force_query_with_job::h961a1a8f48ff034b
  48:     0x7fd2807f09af - rustc_query_system::query::plumbing::get_query_impl::h5cd26487eff2131e
  49:     0x7fd2808e35cf - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::index_hir::hf2b2ac559a14a0d9
  50:     0x7fd2803e6487 - core::ops::function::FnOnce::call_once::hff88764e303a68c4
  51:     0x7fd27fdf30b5 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hc0460b29df8a668f
  52:     0x7fd27fd997ee - rustc_query_system::query::plumbing::force_query_with_job::h8d24115ee3a536a8
  53:     0x7fd27fd7d390 - rustc_query_system::query::plumbing::get_query_impl::h9285eb59969e22c8
  54:     0x7fd27fddd43f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::hir_owner::h8cf23765d3e4de6b
  55:     0x7fd2803ebcd9 - rustc_middle::hir::map::Map::find_entry::h29d0e05ce7362da9
  56:     0x7fd2803ec136 - <rustc_middle::hir::map::Map as rustc_hir::intravisit::Map>::item::h5a1c6a1d862795bc
  57:     0x7fd27fe7c2c0 - rustc_middle::hir::map::Map::visit_item_likes_in_module::hf01ac21b956183d6
  58:     0x7fd2809c6294 - rustc_passes::hir_id_validator::check_crate::hb29522cb7117c68c
  59:     0x7fd28048ff76 - rustc_interface::passes::analysis::h84e230aa18168bec
  60:     0x7fd2809076b5 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::ha9ecb0a4a5f74d0a
  61:     0x7fd280969b87 - rustc_data_structures::stack::ensure_sufficient_stack::hfc73cb57dd5c4995
  62:     0x7fd280834161 - rustc_query_system::query::plumbing::force_query_with_job::h3b03867f47f56f3f
  63:     0x7fd28080aeff - rustc_query_system::query::plumbing::get_query_impl::hb5cdf9a8bb6380d7
  64:     0x7fd2808e372f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::he7fb436d5ea44844
  65:     0x7fd28047da6b - rustc_interface::passes::QueryContext::enter::h6632cc7bc285eb19
  66:     0x7fd280449425 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h2731ac3c02105c7c
  67:     0x7fd28047e071 - rustc_span::with_source_map::h94d38a1c3089ae35
  68:     0x7fd28044a3ee - rustc_interface::interface::create_compiler_and_run::h2bc2789fb7dc8d5b
  69:     0x7fd280444b78 - scoped_tls::ScopedKey<T>::set::hc4c30e2561747f9c
  70:     0x7fd28044a7c4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h904e8f4f3fa6a302
  71:     0x7fd28046c0f5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::he1a228660be11f81
  72:     0x7fd27e053cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7f7bdfc757a1add0
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/alloc/src/boxed.rs:1546:9
  73:     0x7fd27e053cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha294ad0fb99e9b3a
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/alloc/src/boxed.rs:1546:9
  74:     0x7fd27e053cf3 - std::sys::unix::thread::Thread::new::thread_start::h4614854ae73cd6b0
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys/unix/thread.rs:71:17
  75:     0x7fd27df7e609 - start_thread
  76:     0x7fd27de92293 - 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.53.0-nightly (07e0e2ec2 2021-03-24) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
Illegal instruction (core dumped)
Backtrace

error: bounds on `type`s in this context have no effect
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:24
  |
1 |   type PairCoupledTypes: Trait<
  |  ________________________^
2 | |     [u32; {
3 | |         static FOO: usize;
4 | |     }],
5 | | > = impl Trait<
  | |_^

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:9
  |
3 |         static FOO: usize;
  |         ^^^^^^^^^^^^^^^^^-
  |                          |
  |                          help: provide a definition for the static: `= <expr>;`

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:7:9
  |
7 |         static FOO: usize;
  |         ^^^^^^^^^^^^^^^^^-
  |                          |
  |                          help: provide a definition for the static: `= <expr>;`

error[E0405]: cannot find trait `Trait` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:24
  |
1 | type PairCoupledTypes: Trait<
  |                        ^^^^^ not found in this scope

error[E0405]: cannot find trait `Trait` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:10
  |
5 | > = impl Trait<
  |          ^^^^^ not found in this scope

error[E0658]: `impl Trait` in type aliases is unstable
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:5
  |
5 |   > = impl Trait<
  |  _____^
6 | |     [u32; {
7 | |         static FOO: usize;
8 | |     }],
9 | | >;
  | |_^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/hir/map/collector.rs:156:78
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:50:5
   3: rustc_middle::hir::map::collector::NodeCollector::finalize_and_compute_crate_hash
   4: rustc_middle::hir::map::index_hir
   5: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   6: rustc_data_structures::stack::ensure_sufficient_stack
   7: rustc_query_system::query::plumbing::force_query_with_job
   8: rustc_query_system::query::plumbing::get_query_impl
   9: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::index_hir
  10: core::ops::function::FnOnce::call_once
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  12: rustc_query_system::query::plumbing::force_query_with_job
  13: rustc_query_system::query::plumbing::get_query_impl
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::hir_owner
  15: rustc_middle::hir::map::Map::find_entry
  16: <rustc_middle::hir::map::Map as rustc_hir::intravisit::Map>::item
  17: rustc_middle::hir::map::Map::visit_item_likes_in_module
  18: rustc_passes::hir_id_validator::check_crate
  19: rustc_interface::passes::analysis
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::force_query_with_job
  23: rustc_query_system::query::plumbing::get_query_impl
  24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  25: rustc_interface::passes::QueryContext::enter
  26: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  27: rustc_span::with_source_map
  28: rustc_interface::interface::create_compiler_and_run
  29: scoped_tls::ScopedKey<T>::set
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.53.0-nightly (07e0e2ec2 2021-03-24) running on x86_64-unknown-linux-gnu

query stack during panic:
thread 'rustc' panicked at 'already borrowed: BorrowMutError', /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/compiler/rustc_data_structures/src/sync.rs:481:16
stack backtrace:
   0:     0x7f249c32ff80 - std::backtrace_rs::backtrace::libunwind::trace::h4dee703919bfd40a
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f249c32ff80 - std::backtrace_rs::backtrace::trace_unsynchronized::h457e839f1a563e20
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f249c32ff80 - std::sys_common::backtrace::_print_fmt::h86a55fb30f8393c8
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f249c32ff80 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7b3d6cac46d277e1
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f249c39e8df - core::fmt::write::h127419eb46f2ecc9
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/fmt/mod.rs:1092:17
   5:     0x7f249c324505 - std::io::Write::write_fmt::h6010cfbb4726588b
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/io/mod.rs:1578:15
   6:     0x7f249c333cbb - std::sys_common::backtrace::_print::h79b4f9652330cc9d
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f249c333cbb - std::sys_common::backtrace::print::h330bb326a76af8cf
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f249c333cbb - std::panicking::default_hook::{{closure}}::heb6a42a7d50a472e
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:208:50
   9:     0x7f249c333783 - std::panicking::default_hook::h17e521ba6d68d6e1
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:225:9
  10:     0x7f249cb05f2b - rustc_driver::report_ice::ha40982d59fc75b99
  11:     0x7f249c3343d0 - std::panicking::rust_panic_with_hook::h70db735e3a6e70cb
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:595:17
  12:     0x7f249c333fa7 - std::panicking::begin_panic_handler::{{closure}}::h777c71c8e5a7e25c
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:497:13
  13:     0x7f249c33043c - std::sys_common::backtrace::__rust_end_short_backtrace::h3e9bf30168899554
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f249c333f09 - rust_begin_unwind
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
  15:     0x7f249c2faf31 - core::panicking::panic_fmt::h5322a082d19786c3
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
  16:     0x7f249c2fae23 - core::option::expect_none_failed::h354eaa93a51d71b8
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/option.rs:1329:5
  17:     0x7f249e06d6b1 - rustc_query_system::query::plumbing::get_query_impl::h9285eb59969e22c8
  18:     0x7f249e0cd43f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::hir_owner::h8cf23765d3e4de6b
  19:     0x7f249e6dbcd9 - rustc_middle::hir::map::Map::find_entry::h29d0e05ce7362da9
  20:     0x7f249e6de781 - rustc_middle::hir::map::Map::opt_span::h0e633ec6695201db
  21:     0x7f249e6d5bb4 - core::ops::function::FnOnce::call_once::h8e8fc2e78b42ea40
  22:     0x7f249e0e5fef - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::heb66790eab05aa9c
  23:     0x7f249e08edc6 - rustc_query_system::query::plumbing::force_query_with_job::hd99723bfec38226e
  24:     0x7f249e0581aa - rustc_query_system::query::plumbing::get_query_impl::h29f54ecbf531e372
  25:     0x7f249e0cf2ca - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::def_span::hf8951f7e9bd1bf9c
  26:     0x7f249d113f40 - <rustc_span::def_id::DefId as rustc_query_impl::keys::Key>::default_span::h1c3c7dc090c3f014
  27:     0x7f249d113e68 - <rustc_span::def_id::LocalDefId as rustc_query_impl::keys::Key>::default_span::heda70f45b0543b34
  28:     0x7f249d28f123 - rustc_query_impl::make_query::hir_owner::h3da83ab69db93eaa
  29:     0x7f249d32f777 - <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::hd1991837c2161eb2
  30:     0x7f249d30bd2e - <hashbrown::map::HashMap<K,V,S,A> as core::iter::traits::collect::Extend<(K,V)>>::extend::hd6666d2b93c8a6ad
  31:     0x7f249d081619 - rustc_query_system::query::plumbing::QueryState<D,K>::try_collect_active_jobs::h9e1d046a9d6f2a48
  32:     0x7f249d1c6215 - rustc_query_impl::Queries::try_collect_active_jobs::hde35c82843c1c977
  33:     0x7f249d28de10 - <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::try_collect_active_jobs::h074fbdf881b5d394
  34:     0x7f249d0e4efc - rustc_query_system::query::job::print_query_stack::hc8bd6fa9da6896ed
  35:     0x7f249cbd8018 - rustc_interface::interface::try_print_query_stack::h52edfe36792d8caa
  36:     0x7f249cb06338 - rustc_driver::report_ice::ha40982d59fc75b99
  37:     0x7f249c3343d0 - std::panicking::rust_panic_with_hook::h70db735e3a6e70cb
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:595:17
  38:     0x7f249c333f77 - std::panicking::begin_panic_handler::{{closure}}::h777c71c8e5a7e25c
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:495:13
  39:     0x7f249c33043c - std::sys_common::backtrace::__rust_end_short_backtrace::h3e9bf30168899554
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys_common/backtrace.rs:141:18
  40:     0x7f249c333f09 - rust_begin_unwind
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
  41:     0x7f249c2faf31 - core::panicking::panic_fmt::h5322a082d19786c3
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
  42:     0x7f249c2fae7d - core::panicking::panic::haebb15b6842d6229
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:50:5
  43:     0x7f249e6748f3 - rustc_middle::hir::map::collector::NodeCollector::finalize_and_compute_crate_hash::ha4f7aa4c32ef1fb5
  44:     0x7f249f087e48 - rustc_middle::hir::map::index_hir::h8d13710fbf6ecbc7
  45:     0x7f249ebf9f75 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hb443d6bb581e91b6
  46:     0x7f249ec56f17 - rustc_data_structures::stack::ensure_sufficient_stack::he0c6c8cfc8bd647a
  47:     0x7f249eb2d5c1 - rustc_query_system::query::plumbing::force_query_with_job::h961a1a8f48ff034b
  48:     0x7f249eae09af - rustc_query_system::query::plumbing::get_query_impl::h5cd26487eff2131e
  49:     0x7f249ebd35cf - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::index_hir::hf2b2ac559a14a0d9
  50:     0x7f249e6d6487 - core::ops::function::FnOnce::call_once::hff88764e303a68c4
  51:     0x7f249e0e30b5 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hc0460b29df8a668f
  52:     0x7f249e0897ee - rustc_query_system::query::plumbing::force_query_with_job::h8d24115ee3a536a8
  53:     0x7f249e06d390 - rustc_query_system::query::plumbing::get_query_impl::h9285eb59969e22c8
  54:     0x7f249e0cd43f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::hir_owner::h8cf23765d3e4de6b
  55:     0x7f249e6dbcd9 - rustc_middle::hir::map::Map::find_entry::h29d0e05ce7362da9
  56:     0x7f249e6dc136 - <rustc_middle::hir::map::Map as rustc_hir::intravisit::Map>::item::h5a1c6a1d862795bc
  57:     0x7f249e16c2c0 - rustc_middle::hir::map::Map::visit_item_likes_in_module::hf01ac21b956183d6
  58:     0x7f249ecb6294 - rustc_passes::hir_id_validator::check_crate::hb29522cb7117c68c
  59:     0x7f249e77ff76 - rustc_interface::passes::analysis::h84e230aa18168bec
  60:     0x7f249ebf76b5 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::ha9ecb0a4a5f74d0a
  61:     0x7f249ec59b87 - rustc_data_structures::stack::ensure_sufficient_stack::hfc73cb57dd5c4995
  62:     0x7f249eb24161 - rustc_query_system::query::plumbing::force_query_with_job::h3b03867f47f56f3f
  63:     0x7f249eafaeff - rustc_query_system::query::plumbing::get_query_impl::hb5cdf9a8bb6380d7
  64:     0x7f249ebd372f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::he7fb436d5ea44844
  65:     0x7f249e76da6b - rustc_interface::passes::QueryContext::enter::h6632cc7bc285eb19
  66:     0x7f249e739425 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h2731ac3c02105c7c
  67:     0x7f249e76e071 - rustc_span::with_source_map::h94d38a1c3089ae35
  68:     0x7f249e73a3ee - rustc_interface::interface::create_compiler_and_run::h2bc2789fb7dc8d5b
  69:     0x7f249e734b78 - scoped_tls::ScopedKey<T>::set::hc4c30e2561747f9c
  70:     0x7f249e73a7c4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h904e8f4f3fa6a302
  71:     0x7f249e75c0f5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::he1a228660be11f81
  72:     0x7f249c343cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7f7bdfc757a1add0
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/alloc/src/boxed.rs:1546:9
  73:     0x7f249c343cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha294ad0fb99e9b3a
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/alloc/src/boxed.rs:1546:9
  74:     0x7f249c343cf3 - std::sys::unix::thread::Thread::new::thread_start::h4614854ae73cd6b0
                               at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/sys/unix/thread.rs:71:17
  75:     0x7f249c26e609 - start_thread
  76:     0x7f249c182293 - 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.53.0-nightly (07e0e2ec2 2021-03-24) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
Illegal instruction (core dumped)

@chengniansun chengniansun 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 25, 2021
@jonas-schievink jonas-schievink added A-HIR Area: The high-level intermediate representation (HIR) A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. labels Mar 25, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Mar 26, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 27, 2021
@chengniansun
Copy link
Author

A duplicate

mod a {
    pub mod b {
        pub mod c {
            pub struct S<T>;
        }
    }
}
macro_rules! import {
    ( $ p : path ) => {
        use $p;
    };
}
fn f1() {
    import! { a :: b :: c :: S < u8 > }
}
fn f2() {}
fn main() {}

@Alexendoo
Copy link
Member

No longer ICEs since #89124

@Alexendoo Alexendoo added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 19, 2021
@JohnTitor
Copy link
Member

The minimized second example fails to debug-assert here:

debug_assert_eq!(self.owner, hir_id.owner);

Backtrace

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `DefId(0:8)`,
 right: `DefId(0:9)`', compiler/rustc_ast_lowering/src/index.rs:77:9
stack backtrace:
   0: rust_begin_unwind
             at ./library/std/src/panicking.rs:495:5
   1: core::panicking::panic_fmt
             at ./library/core/src/panicking.rs:107:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at ./library/core/src/panicking.rs:145:5
   4: rustc_ast_lowering::index::NodeCollector::insert
             at ./compiler/rustc_ast_lowering/src/index.rs:77:9
   5: <rustc_ast_lowering::index::NodeCollector as rustc_hir::intravisit::Visitor>::visit_ty
             at ./compiler/rustc_ast_lowering/src/index.rs:257:9
   6: rustc_hir::intravisit::walk_generic_args
             at ./compiler/rustc_hir/src/intravisit.rs:804:5
   7: rustc_hir::intravisit::walk_path
             at ./compiler/rustc_hir/src/intravisit.rs:783:9
   8: rustc_hir::intravisit::Visitor::visit_path
             at ./compiler/rustc_hir/src/intravisit.rs:478:9
   9: rustc_hir::intravisit::walk_use
             at ./compiler/rustc_hir/src/intravisit.rs:687:5
  10: rustc_hir::intravisit::Visitor::visit_use
             at ./compiler/rustc_hir/src/intravisit.rs:406:9
  11: rustc_hir::intravisit::walk_item
             at ./compiler/rustc_hir/src/intravisit.rs:576:13
  12: <rustc_ast_lowering::index::NodeCollector as rustc_hir::intravisit::Visitor>::visit_item::{{closure}}
             at ./compiler/rustc_ast_lowering/src/index.rs:169:13
  13: rustc_ast_lowering::index::NodeCollector::with_parent
             at ./compiler/rustc_ast_lowering/src/index.rs:108:9
  14: <rustc_ast_lowering::index::NodeCollector as rustc_hir::intravisit::Visitor>::visit_item
             at ./compiler/rustc_ast_lowering/src/index.rs:162:9
  15: rustc_ast_lowering::index::index_hir
             at ./compiler/rustc_ast_lowering/src/index.rs:66:34
  16: rustc_ast_lowering::LoweringContext::make_owner_info
             at ./compiler/rustc_ast_lowering/src/lib.rs:502:13
  17: rustc_ast_lowering::LoweringContext::with_hir_id_owner
             at ./compiler/rustc_ast_lowering/src/lib.rs:465:20
  18: <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_item
             at ./compiler/rustc_ast_lowering/src/item.rs:44:22
  19: rustc_ast::visit::walk_stmt
             at ./compiler/rustc_ast/src/visit.rs:692:37
  20: rustc_ast::visit::Visitor::visit_stmt
             at ./compiler/rustc_ast/src/visit.rs:103:9
  21: rustc_ast::visit::walk_block
             at ./compiler/rustc_ast/src/visit.rs:686:5
  22: rustc_ast::visit::Visitor::visit_block
             at ./compiler/rustc_ast/src/visit.rs:100:9
  23: rustc_ast::visit::walk_fn
             at ./compiler/rustc_ast/src/visit.rs:637:13
  24: <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_fn
             at ./compiler/rustc_ast_lowering/src/item.rs:68:18
  25: rustc_ast::visit::walk_item
             at ./compiler/rustc_ast/src/visit.rs:291:13
  26: <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_item::{{closure}}
             at ./compiler/rustc_ast_lowering/src/item.rs:55:22
  27: rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::with_parent_item_lifetime_defs
             at ./compiler/rustc_ast_lowering/src/item.rs:115:19
  28: <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_item
             at ./compiler/rustc_ast_lowering/src/item.rs:49:9
  29: rustc_ast::visit::walk_crate
             at ./compiler/rustc_ast/src/visit.rs:235:5
  30: rustc_ast_lowering::LoweringContext::lower_crate
             at ./compiler/rustc_ast_lowering/src/lib.rs:396:9
  31: rustc_ast_lowering::lower_crate
             at ./compiler/rustc_ast_lowering/src/lib.rs:297:5
  32: rustc_interface::passes::lower_to_hir
             at ./compiler/rustc_interface/src/passes.rs:464:21
  33: rustc_interface::passes::create_global_ctxt
             at ./compiler/rustc_interface/src/passes.rs:807:17
  34: rustc_interface::queries::Queries::global_ctxt::{{closure}}
             at ./compiler/rustc_interface/src/queries.rs:226:16
  35: rustc_interface::queries::Query<T>::compute
             at ./compiler/rustc_interface/src/queries.rs:38:28
  36: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:377:13
  37: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at ./compiler/rustc_interface/src/queries.rs:390:19
  38: rustc_driver::run_compiler::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:312:22
  39: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at ./compiler/rustc_interface/src/interface.rs:203:13
  40: rustc_span::with_source_map
             at ./compiler/rustc_span/src/lib.rs:976:5
  41: rustc_interface::interface::create_compiler_and_run
             at ./compiler/rustc_interface/src/interface.rs:197:5
  42: rustc_interface::interface::run_compiler::{{closure}}
             at ./compiler/rustc_interface/src/interface.rs:219:12
  43: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:145:13
  44: scoped_tls::ScopedKey<T>::set
             at .cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  45: rustc_span::create_session_globals_then
             at ./compiler/rustc_span/src/lib.rs:109:5
  46: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:143:9

@JohnTitor JohnTitor added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) and removed A-HIR Area: The high-level intermediate representation (HIR) A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. labels Oct 20, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 21, 2021
…crum

Add a regression test for issue-83479

Add a regression test for rust-lang#83479 (comment), but not close the issue, see rust-lang#83479 (comment).
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 21, 2021
…crum

Add a regression test for issue-83479

Add a regression test for rust-lang#83479 (comment), but not close the issue, see rust-lang#83479 (comment).
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 22, 2021
…crum

Add a regression test for issue-83479

Add a regression test for rust-lang#83479 (comment), but not close the issue, see rust-lang#83479 (comment).
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 22, 2021
…crum

Add a regression test for issue-83479

Add a regression test for rust-lang#83479 (comment), but not close the issue, see rust-lang#83479 (comment).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 22, 2021
…crum

Add a regression test for issue-83479

Add a regression test for rust-lang#83479 (comment), but not close the issue, see rust-lang#83479 (comment).
@cjgillot cjgillot assigned cjgillot and unassigned cjgillot Nov 26, 2021
@cjgillot cjgillot removed the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Nov 26, 2021
@matthiaskrgr matthiaskrgr added the requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way label Jun 29, 2022
@JohnTitor JohnTitor removed E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. labels Dec 22, 2022
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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions 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

7 participants