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: no name for HirId #115264

Closed
matthiaskrgr opened this issue Aug 27, 2023 · 4 comments · Fixed by #115400
Closed

ICE: no name for HirId #115264

matthiaskrgr opened this issue Aug 27, 2023 · 4 comments · Fixed by #115400
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Aug 27, 2023

Code

struct X;

fn main() {
    let _ = X {
        #[doc(alias = "StructItem")]
        foo: 123,
    };
}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (69e97df5c 2023-08-26)
binary: rustc
commit-hash: 69e97df5ce571a777acd654ec3697ae8d25962ea
commit-date: 2023-08-26
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

<output>
Backtrace

error: internal compiler error: compiler/rustc_middle/src/hir/map/mod.rs:908:45: no name for HirId(DefId(0:5 ~ 18E49BCD6AC5CB54039B8039700A54237CD2A2A1AAC1CD5DD80B8A3E7FAB5E2E[059a]::main).4) (expr field `foo: 123`)

thread 'rustc' panicked at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/compiler/rustc_errors/src/lib.rs:1649:9:
Box<dyn Any>
stack backtrace:
   0:     0x7fd4bf562fac - std::backtrace_rs::backtrace::libunwind::trace::h7ead10aab469b9aa
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd4bf562fac - std::backtrace_rs::backtrace::trace_unsynchronized::hf548e9e8c1fe3e8d
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd4bf562fac - std::sys_common::backtrace::_print_fmt::h4f790d56eeca616b
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fd4bf562fac - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h30e5bb3d4404f378
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd4bf5c91dc - core::fmt::rt::Argument::fmt::h35f06f2256f98b43
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/core/src/fmt/rt.rs:138:9
   5:     0x7fd4bf5c91dc - core::fmt::write::h5005ce68dd6774c4
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fd4bf555cae - std::io::Write::write_fmt::h8a7c95ddeefaf4be
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/io/mod.rs:1714:15
   7:     0x7fd4bf562d94 - std::sys_common::backtrace::_print::hedccafa15bd98864
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd4bf562d94 - std::sys_common::backtrace::print::h911d101d11c4e8b0
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd4bf565e8a - std::panicking::panic_hook_with_disk_dump::{{closure}}::he8cf7cbd1dd11756
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/panicking.rs:278:22
  10:     0x7fd4bf565b78 - std::panicking::panic_hook_with_disk_dump::h3baf172fecd393f6
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/panicking.rs:312:9
  11:     0x7fd4c274a279 - <rustc_driver_impl[98acc53e2d2f6ece]::install_ice_hook::{closure#0} as core[cb689c380e703cde]::ops::function::FnOnce<(&core[cb689c380e703cde]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7fd4bf566731 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h8e3b5b4f77120996
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/alloc/src/boxed.rs:2021:9
  13:     0x7fd4bf566731 - std::panicking::rust_panic_with_hook::hcec56ff9d71a6f8a
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/panicking.rs:733:13
  14:     0x7fd4c2cfa761 - std[ebccec195fc5e844]::panicking::begin_panic::<rustc_errors[20973ea23cc60a53]::ExplicitBug>::{closure#0}
  15:     0x7fd4c2cf8556 - std[ebccec195fc5e844]::sys_common::backtrace::__rust_end_short_backtrace::<std[ebccec195fc5e844]::panicking::begin_panic<rustc_errors[20973ea23cc60a53]::ExplicitBug>::{closure#0}, !>
  16:     0x7fd4c2ca72e6 - std[ebccec195fc5e844]::panicking::begin_panic::<rustc_errors[20973ea23cc60a53]::ExplicitBug>
  17:     0x7fd4c2c64c64 - <rustc_errors[20973ea23cc60a53]::HandlerInner>::bug::<alloc[79ce024021085db3]::string::String>
  18:     0x7fd4c2c64af6 - <rustc_errors[20973ea23cc60a53]::Handler>::bug::<alloc[79ce024021085db3]::string::String>
  19:     0x7fd4c2d1fe3c - rustc_middle[464349d56e47250b]::util::bug::opt_span_bug_fmt::<rustc_span[c92a35b362599b57]::span_encoding::Span>::{closure#0}
  20:     0x7fd4c2d1e47a - rustc_middle[464349d56e47250b]::ty::context::tls::with_opt::<rustc_middle[464349d56e47250b]::util::bug::opt_span_bug_fmt<rustc_span[c92a35b362599b57]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fd4c2d1e448 - rustc_middle[464349d56e47250b]::ty::context::tls::with_context_opt::<rustc_middle[464349d56e47250b]::ty::context::tls::with_opt<rustc_middle[464349d56e47250b]::util::bug::opt_span_bug_fmt<rustc_span[c92a35b362599b57]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fd4c12e3f50 - rustc_middle[464349d56e47250b]::util::bug::bug_fmt
  23:     0x7fd4c16c1d0d - <rustc_middle[464349d56e47250b]::hir::map::Map>::name
  24:     0x7fd4c2fa80c9 - <rustc_passes[1f42b5cdeab0914e]::check_attr::CheckAttrVisitor>::check_doc_alias_value
  25:     0x7fd4c1466bad - <rustc_passes[1f42b5cdeab0914e]::check_attr::CheckAttrVisitor>::check_attributes
  26:     0x7fd4c0b2ec3a - <rustc_passes[1f42b5cdeab0914e]::check_attr::CheckAttrVisitor as rustc_hir[3a72116ea74f2480]::intravisit::Visitor>::visit_expr
  27:     0x7fd4c0b2e998 - <rustc_passes[1f42b5cdeab0914e]::check_attr::CheckAttrVisitor as rustc_hir[3a72116ea74f2480]::intravisit::Visitor>::visit_expr
  28:     0x7fd4c1460e02 - rustc_hir[3a72116ea74f2480]::intravisit::walk_item::<rustc_passes[1f42b5cdeab0914e]::check_attr::CheckAttrVisitor>
  29:     0x7fd4c146043c - <rustc_middle[464349d56e47250b]::hir::map::Map>::visit_item_likes_in_module::<rustc_passes[1f42b5cdeab0914e]::check_attr::CheckAttrVisitor>
  30:     0x7fd4c14601b7 - rustc_passes[1f42b5cdeab0914e]::check_attr::check_mod_attrs
  31:     0x7fd4c147463c - rustc_query_impl[58a3c40f53c1e9dd]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[58a3c40f53c1e9dd]::query_impl::check_mod_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464349d56e47250b]::query::erase::Erased<[u8; 0usize]>>
  32:     0x7fd4c147461e - <rustc_query_impl[58a3c40f53c1e9dd]::query_impl::check_mod_attrs::dynamic_query::{closure#2} as core[cb689c380e703cde]::ops::function::FnOnce<(rustc_middle[464349d56e47250b]::ty::context::TyCtxt, rustc_span[c92a35b362599b57]::def_id::LocalModDefId)>>::call_once
  33:     0x7fd4c1774923 - rustc_query_system[771da89a8e6a97f0]::query::plumbing::try_execute_query::<rustc_query_impl[58a3c40f53c1e9dd]::DynamicConfig<rustc_query_system[771da89a8e6a97f0]::query::caches::DefaultCache<rustc_span[c92a35b362599b57]::def_id::LocalModDefId, rustc_middle[464349d56e47250b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[58a3c40f53c1e9dd]::plumbing::QueryCtxt, false>
  34:     0x7fd4c20cae04 - rustc_query_impl[58a3c40f53c1e9dd]::query_impl::check_mod_attrs::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7fd4c1c89cab - <core[cb689c380e703cde]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[7283f0e76412c80]::sync::par_for_each_in<&[rustc_hir[3a72116ea74f2480]::hir_id::OwnerId], <rustc_middle[464349d56e47250b]::hir::map::Map>::par_for_each_module<rustc_interface[b81038288d48d278]::passes::analysis::{closure#0}::{closure#1}::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}> as core[cb689c380e703cde]::ops::function::FnOnce<()>>::call_once
  36:     0x7fd4c1dc0ef3 - <core[cb689c380e703cde]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[b81038288d48d278]::passes::analysis::{closure#0}::{closure#1}> as core[cb689c380e703cde]::ops::function::FnOnce<()>>::call_once
  37:     0x7fd4c166a82f - <rustc_session[7acd2f890d2e5402]::session::Session>::time::<(), rustc_interface[b81038288d48d278]::passes::analysis::{closure#0}>
  38:     0x7fd4c1669c41 - rustc_interface[b81038288d48d278]::passes::analysis
  39:     0x7fd4c1c5ca4a - rustc_query_impl[58a3c40f53c1e9dd]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[58a3c40f53c1e9dd]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[464349d56e47250b]::query::erase::Erased<[u8; 1usize]>>
  40:     0x7fd4c1c5ca39 - <rustc_query_impl[58a3c40f53c1e9dd]::query_impl::analysis::dynamic_query::{closure#2} as core[cb689c380e703cde]::ops::function::FnOnce<(rustc_middle[464349d56e47250b]::ty::context::TyCtxt, ())>>::call_once
  41:     0x7fd4c1decc18 - rustc_query_system[771da89a8e6a97f0]::query::plumbing::try_execute_query::<rustc_query_impl[58a3c40f53c1e9dd]::DynamicConfig<rustc_query_system[771da89a8e6a97f0]::query::caches::SingleCache<rustc_middle[464349d56e47250b]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[58a3c40f53c1e9dd]::plumbing::QueryCtxt, false>
  42:     0x7fd4c1dec999 - rustc_query_impl[58a3c40f53c1e9dd]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7fd4c1a28da6 - <rustc_middle[464349d56e47250b]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[98acc53e2d2f6ece]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>>
  44:     0x7fd4c1a2822c - <rustc_interface[b81038288d48d278]::interface::Compiler>::enter::<rustc_driver_impl[98acc53e2d2f6ece]::run_compiler::{closure#1}::{closure#2}, core[cb689c380e703cde]::result::Result<core[cb689c380e703cde]::option::Option<rustc_interface[b81038288d48d278]::queries::Linker>, rustc_span[c92a35b362599b57]::ErrorGuaranteed>>
  45:     0x7fd4c1a25548 - std[ebccec195fc5e844]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b81038288d48d278]::util::run_in_thread_pool_with_globals<rustc_interface[b81038288d48d278]::interface::run_compiler<core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>, rustc_driver_impl[98acc53e2d2f6ece]::run_compiler::{closure#1}>::{closure#0}, core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>>
  46:     0x7fd4c1fc60f5 - <<std[ebccec195fc5e844]::thread::Builder>::spawn_unchecked_<rustc_interface[b81038288d48d278]::util::run_in_thread_pool_with_globals<rustc_interface[b81038288d48d278]::interface::run_compiler<core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>, rustc_driver_impl[98acc53e2d2f6ece]::run_compiler::{closure#1}>::{closure#0}, core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[cb689c380e703cde]::result::Result<(), rustc_span[c92a35b362599b57]::ErrorGuaranteed>>::{closure#1} as core[cb689c380e703cde]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7fd4bf571195 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf6677bb1228f81ea
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/alloc/src/boxed.rs:2007:9
  48:     0x7fd4bf571195 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4f3130db7e13aaba
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/alloc/src/boxed.rs:2007:9
  49:     0x7fd4bf571195 - std::sys::unix::thread::Thread::new::thread_start::h17fc5e491c7b31dd
                               at /rustc/69e97df5ce571a777acd654ec3697ae8d25962ea/library/std/src/sys/unix/thread.rs:108:17
  50:     0x7fd4bf08c9eb - <unknown>
  51:     0x7fd4bf110ebc - <unknown>
  52:                0x0 - <unknown>

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: please attach the file at `/tmp/im/clippy/rustc-ice-2023-08-27T07:56:41.916418357Z-198694.txt` to your bug report

query stack during panic:
#0 [check_mod_attrs] checking attributes in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

@matthiaskrgr matthiaskrgr added 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. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. C-bug Category: This is a bug. labels Aug 27, 2023
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 27, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2022-08-16

commit[0] 2022-08-14: Auto merge of #100429 - GuillaumeGomez:merge-html-elements-together, r=notriddle
commit[1] 2022-08-14: Auto merge of #100540 - matthiaskrgr:rollup-734hkpt, r=matthiaskrgr
commit[2] 2022-08-15: Auto merge of #100510 - compiler-errors:as-a-treat, r=jackh726
commit[3] 2022-08-15: Auto merge of #96350 - austinabell:skip_optimization, r=Mark-Simulacrum
commit[4] 2022-08-15: Auto merge of #96745 - ehuss:even-more-attribute-validation, r=cjgillot
commit[5] 2022-08-15: Auto merge of #98393 - michaelwoerister:new-cpp-like-enum-debuginfo, r=wesleywiser
commit[6] 2022-08-15: Auto merge of #100569 - matthiaskrgr:rollup-9450lzs, r=matthiaskrgr
commit[7] 2022-08-15: Auto merge of #100595 - matthiaskrgr:rollup-f1zur58, r=matthiaskrgr

@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 29, 2023
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 29, 2023
@gurry
Copy link
Contributor

gurry commented Aug 30, 2023

@rustbot claim

@gurry
Copy link
Contributor

gurry commented Aug 31, 2023

Originates in PR #96745. We are returning None for ExprField although it does have an ident:

| Node::ExprField(..)

The fix would be to start returning the ident.

PatField suffers from the same problem and may need the same treatment.

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) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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.

5 participants