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: min_specialization: failed while formatting fluent string hir_analysis_impl_not_marked_default_err` #111232

Closed
matthiaskrgr opened this issue May 5, 2023 · 0 comments · Fixed by #111239
Assignees
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented May 5, 2023

Code

#![feature(min_specialization)]

struct S;
impl From<S> for S {
    fn from(s: S) -> S {
        s
    }
}

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (473f916d8 2023-05-03)
binary: rustc
commit-hash: 473f916d836cc662c5bdbb0d40af9fb4678fab9e
commit-date: 2023-05-03
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

<output>
Backtrace

error[E0601]: `main` function not found in crate `treereduce`
  --> treereduce.out:12:10
   |
12 | struct X;
   |          ^ consider adding a `main` function to `treereduce.out`

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `hir_analysis_impl_not_marked_default_err`:
the attribute `label` was missing
help: add `.label = <message>`
', compiler/rustc_errors/src/emitter.rs:2399:77
stack backtrace:
   0:     0x7fb99b969441 - std::backtrace_rs::backtrace::libunwind::trace::h7d7e89c126af8621
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fb99b969441 - std::backtrace_rs::backtrace::trace_unsynchronized::h963fae9bbbf23fd2
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fb99b969441 - std::sys_common::backtrace::_print_fmt::hcab6046e71683b2b
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fb99b969441 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7fe42f78f0b27bad
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fb99b9ca0df - core::fmt::rt::Argument::fmt::h1d5ff34ff75b4775
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/core/src/fmt/rt.rs:138:9
   5:     0x7fb99b9ca0df - core::fmt::write::h17acb3a0f4c83039
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fb99b95c4f1 - std::io::Write::write_fmt::h76edf76528efc321
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/io/mod.rs:1712:15
   7:     0x7fb99b969255 - std::sys_common::backtrace::_print::hab70b5d2f9c30731
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fb99b969255 - std::sys_common::backtrace::print::hc349f5f36c658efa
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fb99b96bee7 - std::panicking::default_hook::{{closure}}::h71577b1775ba103e
  10:     0x7fb99b96bcd4 - std::panicking::default_hook::h677a2421ac99312e
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/panicking.rs:288:9
  11:     0x7fb99eb735b5 - rustc_driver_impl[b62a44a0491bb616]::DEFAULT_HOOK::{closure#0}::{closure#0}
  12:     0x7fb99b96c607 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hbafb897408759b94
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/alloc/src/boxed.rs:1999:9
  13:     0x7fb99b96c607 - std::panicking::rust_panic_with_hook::h15051d74d5177646
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/panicking.rs:695:13
  14:     0x7fb99b96c387 - std::panicking::begin_panic_handler::{{closure}}::hd5e0f78328757c78
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/panicking.rs:582:13
  15:     0x7fb99b969886 - std::sys_common::backtrace::__rust_end_short_backtrace::h5936cd6107015796
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7fb99b96c0f2 - rust_begin_unwind
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/panicking.rs:578:5
  17:     0x7fb99b9c6383 - core::panicking::panic_fmt::h550d9c07c7423061
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/core/src/panicking.rs:67:14
  18:     0x7fb99b9c69a3 - core::result::unwrap_failed::hf71c0194b80e80c9
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/core/src/result.rs:1651:5
  19:     0x7fb99e15d96a - <rustc_errors[7cb7e4203cccff6e]::emitter::FileWithAnnotatedLines>::collect_annotations
  20:     0x7fb99e150516 - <rustc_errors[7cb7e4203cccff6e]::emitter::EmitterWriter>::emit_message_default::{closure#0}
  21:     0x7fb99e149bea - <rustc_errors[7cb7e4203cccff6e]::emitter::EmitterWriter>::emit_messages_default
  22:     0x7fb99e141f1a - <rustc_errors[7cb7e4203cccff6e]::emitter::EmitterWriter as rustc_errors[7cb7e4203cccff6e]::emitter::Emitter>::emit_diagnostic
  23:     0x7fb99e2e4159 - <rustc_errors[7cb7e4203cccff6e]::HandlerInner>::emit_diagnostic::{closure#2}
  24:     0x7fb99e2ff852 - rustc_interface[21cec1d94dbb6fac]::callbacks::track_diagnostic
  25:     0x7fb99dd294d0 - <rustc_errors[7cb7e4203cccff6e]::HandlerInner>::emit_diagnostic
  26:     0x7fb99d82e64e - <rustc_errors[7cb7e4203cccff6e]::Handler>::emit_diagnostic
  27:     0x7fb99dd01d8a - <rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed as rustc_errors[7cb7e4203cccff6e]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  28:     0x7fb99ec81a4d - <rustc_session[65349724d34b65f7]::parse::ParseSess>::emit_err::<rustc_hir_analysis[5e95606301d545]::errors::ImplNotMarkedDefault>
  29:     0x7fb99ec627d6 - rustc_hir_analysis[5e95606301d545]::check::report_forbidden_specialization
  30:     0x7fb99dbc2351 - rustc_hir_analysis[5e95606301d545]::check::check::check_mod_item_types
  31:     0x7fb99e1def51 - rustc_query_system[fe91d5e47043fef5]::query::plumbing::try_execute_query::<rustc_query_impl[b5d85a12cb021c58]::queries::check_mod_item_types, rustc_query_impl[b5d85a12cb021c58]::plumbing::QueryCtxt>
  32:     0x7fb99e1deb91 - rustc_query_impl[b5d85a12cb021c58]::get_query::check_mod_item_types
  33:     0x7fb99dff26b4 - <rustc_middle[d43bf05128c56115]::hir::map::Map>::for_each_module::<rustc_hir_analysis[5e95606301d545]::check_crate::{closure#6}::{closure#0}>
  34:     0x7fb99dfef24b - rustc_hir_analysis[5e95606301d545]::check_crate
  35:     0x7fb99dfe1f45 - rustc_interface[21cec1d94dbb6fac]::passes::analysis
  36:     0x7fb99e2f9067 - rustc_query_system[fe91d5e47043fef5]::query::plumbing::try_execute_query::<rustc_query_impl[b5d85a12cb021c58]::queries::analysis, rustc_query_impl[b5d85a12cb021c58]::plumbing::QueryCtxt>
  37:     0x7fb99e2f8d83 - rustc_query_impl[b5d85a12cb021c58]::get_query::analysis
  38:     0x7fb99de0996f - <rustc_middle[d43bf05128c56115]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[b62a44a0491bb616]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>>
  39:     0x7fb99de08b5f - <rustc_interface[21cec1d94dbb6fac]::interface::Compiler>::enter::<rustc_driver_impl[b62a44a0491bb616]::run_compiler::{closure#1}::{closure#2}, core[aaef91ac196fa841]::result::Result<core[aaef91ac196fa841]::option::Option<rustc_interface[21cec1d94dbb6fac]::queries::Linker>, rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>>
  40:     0x7fb99de062ff - std[f676bdae5d002d88]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[21cec1d94dbb6fac]::util::run_in_thread_pool_with_globals<rustc_interface[21cec1d94dbb6fac]::interface::run_compiler<core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>, rustc_driver_impl[b62a44a0491bb616]::run_compiler::{closure#1}>::{closure#0}, core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>>
  41:     0x7fb99e45ba3e - <<std[f676bdae5d002d88]::thread::Builder>::spawn_unchecked_<rustc_interface[21cec1d94dbb6fac]::util::run_in_thread_pool_with_globals<rustc_interface[21cec1d94dbb6fac]::interface::run_compiler<core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>, rustc_driver_impl[b62a44a0491bb616]::run_compiler::{closure#1}>::{closure#0}, core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[aaef91ac196fa841]::result::Result<(), rustc_span[3a4c48cd7d4d1b0]::ErrorGuaranteed>>::{closure#1} as core[aaef91ac196fa841]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7fb99b976ad5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9ce144e1e2d38d77
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/alloc/src/boxed.rs:1985:9
  43:     0x7fb99b976ad5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4ba76054665f9e1c
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/alloc/src/boxed.rs:1985:9
  44:     0x7fb99b976ad5 - std::sys::unix::thread::Thread::new::thread_start::h27b9b576da10a848
                               at /rustc/473f916d836cc662c5bdbb0d40af9fb4678fab9e/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7fb99b712bb5 - <unknown>
  46:     0x7fb99b794d90 - <unknown>
  47:                0x0 - <unknown>

error: 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.71.0-nightly (473f916d8 2023-05-03) running on x86_64-unknown-linux-gnu

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

Some errors have detailed explanations: E0520, E0601.
For more information about an error, try `rustc --explain E0520`.

@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. C-bug Category: This is a bug. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels May 5, 2023
@TaKO8Ki TaKO8Ki self-assigned this May 5, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 5, 2023
@bors bors closed this as completed in bc4a119 May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants