Skip to content

ICE: failed while formatting fluent string passes_align_on_fields: #143987

Closed

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

struct Data {
    #[align(8)]
    x: usize8,
}

original:

struct Data {
#[align(8)] x : usize8
}

Version information

rustc 1.90.0-nightly (3014e79f9 2025-07-15)
binary: rustc
commit-hash: 3014e79f9c8d5510ea7b3a3b70d171d0948b1e96
commit-date: 2025-07-15
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.8

Possibly related line of code:

let label = label.as_ref().map(|m| {
normalize_whitespace(
&emitter
.translator()
.translate_message(m, args)
.map_err(Report::new)
.unwrap(),
)
});
if lo.line != hi.line {
let ml = MultilineAnnotation {
depth: 1,

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0412]: cannot find type `usize8` in this scope
 --> /tmp/icemaker_global_tempdir.tCI4asTIohWB/rustc_testrunner_tmpdir_reporting.mL7X4EToUuml/mvce.rs:3:8
  |
3 |     x: usize8,
  |        ^^^^^^ help: a builtin type with a similar name exists: `usize`

error[E0658]: the `#[align]` attribute is an experimental feature
 --> /tmp/icemaker_global_tempdir.tCI4asTIohWB/rustc_testrunner_tmpdir_reporting.mL7X4EToUuml/mvce.rs:2:5
  |
2 |     #[align(8)]
  |     ^^^^^^^^^^^
  |
  = note: see issue #82232 <https://github.com/rust-lang/rust/issues/82232> for more information
  = help: add `#![feature(fn_align)]` to the crate attributes to enable
  = note: this compiler was built on 2025-07-15; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.tCI4asTIohWB/rustc_testrunner_tmpdir_reporting.mL7X4EToUuml/mvce.rs:4:2
  |
4 | }
  |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.tCI4asTIohWB/rustc_testrunner_tmpdir_reporting.mL7X4EToUuml/mvce.rs`


thread 'rustc' panicked at compiler/rustc_errors/src/emitter.rs:3117:30:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `passes_align_on_fields`: 
the attribute `label` was missing
help: add `.label = <message>`

stack backtrace:
   0:     0x788056df4b63 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h4af010e4b1354d4d
   1:     0x7880576029b7 - core::fmt::write::h17347e42c9203d6d
   2:     0x788056dea6f3 - std::io::Write::write_fmt::h05610498df74ae59
   3:     0x788056df49c2 - std::sys::backtrace::BacktraceLock::print::h0286e2cc1356b990
   4:     0x788056df8467 - std::panicking::default_hook::{{closure}}::hb566dc96699e42f6
   5:     0x788056df7fcb - std::panicking::default_hook::h1b340523e54d7d17
   6:     0x788055e8e6d3 - std[8431a5d67c83f301]::panicking::update_hook::<alloc[fc29ea6f01862dd9]::boxed::Box<rustc_driver_impl[fdd49284100304e4]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x788056df8cae - std::panicking::rust_panic_with_hook::hceef4321c6f4ad8a
   8:     0x788056df89aa - std::panicking::begin_panic_handler::{{closure}}::hf9fd67a226c3bb3d
   9:     0x788056df5029 - std::sys::backtrace::__rust_end_short_backtrace::h52410ec1fdc70787
  10:     0x788056df868d - __rustc[507298ddafb0ef2f]::rust_begin_unwind
  11:     0x7880534f2930 - core::panicking::panic_fmt::hf04b323265684a46
  12:     0x7880535709c6 - core::result::unwrap_failed::hdf92484becbba54e
  13:     0x788058c0d166 - <rustc_errors[61709cc4d5caccb3]::emitter::FileWithAnnotatedLines>::collect_annotations
  14:     0x788058c101b0 - <rustc_errors[61709cc4d5caccb3]::emitter::HumanEmitter>::emit_messages_default_inner::{closure#0}
  15:     0x788058acca08 - <rustc_errors[61709cc4d5caccb3]::emitter::HumanEmitter as rustc_errors[61709cc4d5caccb3]::emitter::Emitter>::emit_diagnostic
  16:     0x788058ad46b7 - <rustc_errors[61709cc4d5caccb3]::DiagCtxtInner>::emit_diagnostic::{closure#3}
  17:     0x788058ad232e - rustc_interface[5c27d80bbf0205a9]::callbacks::track_diagnostic::<core[caebfb8306899321]::option::Option<rustc_span[f5894adb1c415d66]::ErrorGuaranteed>>
  18:     0x788058ad12fd - <rustc_errors[61709cc4d5caccb3]::DiagCtxtInner>::emit_diagnostic
  19:     0x788058ad11bf - <rustc_errors[61709cc4d5caccb3]::DiagCtxtHandle>::emit_diagnostic
  20:     0x788058ad1055 - <() as rustc_errors[61709cc4d5caccb3]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  21:     0x788057c80807 - rustc_middle[db85b62c91a80af6]::lint::lint_level::lint_level_impl
  22:     0x788057fdbde4 - <rustc_passes[24702fb08786ebe6]::check_attr::CheckAttrVisitor>::check_attributes
  23:     0x788057fd6310 - <rustc_passes[24702fb08786ebe6]::check_attr::CheckAttrVisitor as rustc_hir[536fe9fb45918b80]::intravisit::Visitor>::visit_item
  24:     0x788053eb72e8 - rustc_passes[24702fb08786ebe6]::check_attr::check_mod_attrs
  25:     0x78805848b3d9 - rustc_query_impl[da0a5435bd9c03d4]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[da0a5435bd9c03d4]::query_impl::check_mod_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[db85b62c91a80af6]::query::erase::Erased<[u8; 0usize]>>
  26:     0x78805848aeda - rustc_query_system[3aa0ab085113fb24]::query::plumbing::try_execute_query::<rustc_query_impl[da0a5435bd9c03d4]::DynamicConfig<rustc_query_system[3aa0ab085113fb24]::query::caches::DefaultCache<rustc_span[f5894adb1c415d66]::def_id::LocalModDefId, rustc_middle[db85b62c91a80af6]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[da0a5435bd9c03d4]::plumbing::QueryCtxt, false>
  27:     0x78805848ac8d - rustc_query_impl[da0a5435bd9c03d4]::query_impl::check_mod_attrs::get_query_non_incr::__rust_end_short_backtrace
  28:     0x78805848aa5b - <rustc_middle[db85b62c91a80af6]::ty::context::TyCtxt>::par_hir_for_each_module::<rustc_interface[5c27d80bbf0205a9]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#1}::{closure#0}>::{closure#0}
  29:     0x788057ffcecc - rustc_interface[5c27d80bbf0205a9]::passes::analysis
  30:     0x788057ffcbef - rustc_query_impl[da0a5435bd9c03d4]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[da0a5435bd9c03d4]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[db85b62c91a80af6]::query::erase::Erased<[u8; 0usize]>>
  31:     0x7880586acdbc - rustc_query_system[3aa0ab085113fb24]::query::plumbing::try_execute_query::<rustc_query_impl[da0a5435bd9c03d4]::DynamicConfig<rustc_query_system[3aa0ab085113fb24]::query::caches::SingleCache<rustc_middle[db85b62c91a80af6]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[da0a5435bd9c03d4]::plumbing::QueryCtxt, false>
  32:     0x7880586ac984 - rustc_query_impl[da0a5435bd9c03d4]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  33:     0x78805890860b - rustc_interface[5c27d80bbf0205a9]::passes::create_and_enter_global_ctxt::<core[caebfb8306899321]::option::Option<rustc_interface[5c27d80bbf0205a9]::queries::Linker>, rustc_driver_impl[fdd49284100304e4]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  34:     0x7880588f64d4 - rustc_interface[5c27d80bbf0205a9]::interface::run_compiler::<(), rustc_driver_impl[fdd49284100304e4]::run_compiler::{closure#0}>::{closure#1}
  35:     0x7880587c1538 - std[8431a5d67c83f301]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[5c27d80bbf0205a9]::util::run_in_thread_with_globals<rustc_interface[5c27d80bbf0205a9]::util::run_in_thread_pool_with_globals<rustc_interface[5c27d80bbf0205a9]::interface::run_compiler<(), rustc_driver_impl[fdd49284100304e4]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  36:     0x7880587c1216 - <<std[8431a5d67c83f301]::thread::Builder>::spawn_unchecked_<rustc_interface[5c27d80bbf0205a9]::util::run_in_thread_with_globals<rustc_interface[5c27d80bbf0205a9]::util::run_in_thread_pool_with_globals<rustc_interface[5c27d80bbf0205a9]::interface::run_compiler<(), rustc_driver_impl[fdd49284100304e4]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[caebfb8306899321]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7880587c733d - std::sys::pal::unix::thread::Thread::new::thread_start::hae446d0e444b0387
  38:     0x7880520a57eb - <unknown>
  39:     0x78805212918c - <unknown>
  40:                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: please make sure that you have updated to the latest nightly

note: rustc 1.90.0-nightly (3014e79f9 2025-07-15) running on x86_64-unknown-linux-gnu

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 3 previous errors; 1 warning emitted

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

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Jul 15, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jul 15, 2025
  3. matthiaskrgr commented on Jul 15, 2025

    @matthiaskrgr
    MemberAuthor
  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jul 16, 2025
  5. matthiaskrgr commented on Jul 22, 2025

    @matthiaskrgr
    MemberAuthor

    struct Hash(#[rustc_align(32)] [()]);

  6. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Oct 18, 2025
  7. Aditya-PS-05 commented on Nov 27, 2025

    @Aditya-PS-05
    Contributor

    @rustbot claim

  8. added a commit that references this issue on Nov 28, 2025
  9. added 2 commits that reference this issue on Nov 28, 2025
  10. added a commit that references this issue on Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-fn_align`#![feature(fn_align)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions