Skip to content

ICE: can't get the span of an arbitrary parsed attribute: Parsed(Repr([(ReprEmpty..  #138510

Open
@matthiaskrgr

Description

@matthiaskrgr

snippet:

fn main()
where
    #[repr()]
    _: Sized,
{
}

Version information

rustc 1.87.0-nightly (cb50d4d85 2025-03-14)
binary: rustc
commit-hash: cb50d4d8566b1ee97e9a5ef95a37a40936a62c30
commit-date: 2025-03-14
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

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

Program output

error[E0658]: attributes in `where` clause are unstable
 --> /tmp/icemaker_global_tempdir.dSJMN8Rutx4j/rustc_testrunner_tmpdir_reporting.kkCezvrEpRdI/mvce.rs:3:5
  |
3 |     #[repr()]
  |     ^^^^^^^^^
  |
  = note: see issue #115590 <https://github.com/rust-lang/rust/issues/115590> for more information
  = help: add `#![feature(where_clause_attrs)]` to the crate attributes to enable
  = note: this compiler was built on 2025-03-14; consider upgrading it if it is out of date


thread 'rustc' panicked at /rustc/cb50d4d8566b1ee97e9a5ef95a37a40936a62c30/compiler/rustc_hir/src/hir.rs:1165:18:
can't get the span of an arbitrary parsed attribute: Parsed(Repr([(ReprEmpty, /tmp/icemaker_global_tempdir.dSJMN8Rutx4j/rustc_testrunner_tmpdir_reporting.kkCezvrEpRdI/mvce.rs:3:5: 3:14 (#0))]))
stack backtrace:
   0:     0x7a384882d653 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hcee62f518447870e
   1:     0x7a3849005a18 - core::fmt::write::h27cd01af81ceb4bc
   2:     0x7a384a3c6cd1 - std::io::Write::write_fmt::h3fae38031a83a288
   3:     0x7a384882d4b2 - std::sys::backtrace::BacktraceLock::print::h30a87b10efbda37d
   4:     0x7a384882fd6a - std::panicking::default_hook::{{closure}}::h5b49739a82da6f3d
   5:     0x7a384882f8ef - std::panicking::default_hook::hff425007b35d7b2b
   6:     0x7a38478956cf - std[953e9802a0bb60c8]::panicking::update_hook::<alloc[84109a1b426c75b9]::boxed::Box<rustc_driver_impl[1ae33b22511c0177]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7a38488305e3 - std::panicking::rust_panic_with_hook::h4ddcc55e731d01a8
   8:     0x7a38488302da - std::panicking::begin_panic_handler::{{closure}}::hbff9be387074c780
   9:     0x7a384882db29 - std::sys::backtrace::__rust_end_short_backtrace::h997f232a686bd3a2
  10:     0x7a384882ff9d - rust_begin_unwind
  11:     0x7a3845271e40 - core::panicking::panic_fmt::h7ec2c6db1402f4b7
  12:     0x7a38494812d0 - <rustc_passes[e15aa05501a9fc5f]::check_attr::CheckAttrVisitor as rustc_hir[8144b75a7235bff8]::intravisit::Visitor>::visit_generics
  13:     0x7a384947d2ca - rustc_hir[8144b75a7235bff8]::intravisit::walk_fn::<rustc_passes[e15aa05501a9fc5f]::check_attr::CheckAttrVisitor>
  14:     0x7a38494800cb - <rustc_passes[e15aa05501a9fc5f]::check_attr::CheckAttrVisitor as rustc_hir[8144b75a7235bff8]::intravisit::Visitor>::visit_item
  15:     0x7a384947f649 - rustc_passes[e15aa05501a9fc5f]::check_attr::check_mod_attrs
  16:     0x7a384947f4e7 - rustc_query_impl[2279fe029c5b5028]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2279fe029c5b5028]::query_impl::check_mod_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[819aed02f283428b]::query::erase::Erased<[u8; 0usize]>>
  17:     0x7a3849f8df23 - rustc_query_system[ac1caa99fcbc3072]::query::plumbing::try_execute_query::<rustc_query_impl[2279fe029c5b5028]::DynamicConfig<rustc_query_system[ac1caa99fcbc3072]::query::caches::DefaultCache<rustc_span[9a5d3eb7a848fcbd]::def_id::LocalModDefId, rustc_middle[819aed02f283428b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2279fe029c5b5028]::plumbing::QueryCtxt, false>
  18:     0x7a3849f8dc3e - rustc_query_impl[2279fe029c5b5028]::query_impl::check_mod_attrs::get_query_non_incr::__rust_end_short_backtrace
  19:     0x7a3849f8d838 - <rustc_middle[819aed02f283428b]::ty::context::TyCtxt>::par_hir_for_each_module::<rustc_interface[85af700e4051aa3b]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#1}::{closure#0}>::{closure#0}
  20:     0x7a38493dc59b - rustc_interface[85af700e4051aa3b]::passes::run_required_analyses
  21:     0x7a3849f8fede - rustc_interface[85af700e4051aa3b]::passes::analysis
  22:     0x7a3849f8fead - rustc_query_impl[2279fe029c5b5028]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2279fe029c5b5028]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[819aed02f283428b]::query::erase::Erased<[u8; 0usize]>>
  23:     0x7a384a178481 - rustc_query_system[ac1caa99fcbc3072]::query::plumbing::try_execute_query::<rustc_query_impl[2279fe029c5b5028]::DynamicConfig<rustc_query_system[ac1caa99fcbc3072]::query::caches::SingleCache<rustc_middle[819aed02f283428b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2279fe029c5b5028]::plumbing::QueryCtxt, false>
  24:     0x7a384a178174 - rustc_query_impl[2279fe029c5b5028]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  25:     0x7a384a3652bd - rustc_interface[85af700e4051aa3b]::passes::create_and_enter_global_ctxt::<core[bfd967786998075b]::option::Option<rustc_interface[85af700e4051aa3b]::queries::Linker>, rustc_driver_impl[1ae33b22511c0177]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  26:     0x7a384a158d60 - rustc_interface[85af700e4051aa3b]::interface::run_compiler::<(), rustc_driver_impl[1ae33b22511c0177]::run_compiler::{closure#0}>::{closure#1}
  27:     0x7a3849f6f592 - std[953e9802a0bb60c8]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[85af700e4051aa3b]::util::run_in_thread_with_globals<rustc_interface[85af700e4051aa3b]::util::run_in_thread_pool_with_globals<rustc_interface[85af700e4051aa3b]::interface::run_compiler<(), rustc_driver_impl[1ae33b22511c0177]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  28:     0x7a3849f6fe74 - <<std[953e9802a0bb60c8]::thread::Builder>::spawn_unchecked_<rustc_interface[85af700e4051aa3b]::util::run_in_thread_with_globals<rustc_interface[85af700e4051aa3b]::util::run_in_thread_pool_with_globals<rustc_interface[85af700e4051aa3b]::interface::run_compiler<(), rustc_driver_impl[1ae33b22511c0177]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[bfd967786998075b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7a3849f7126b - std::sys::pal::unix::thread::Thread::new::thread_start::he937a56b5698a79a
  30:     0x7a3843e5e70a - <unknown>
  31:     0x7a3843ee2aac - <unknown>
  32:                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.87.0-nightly (cb50d4d85 2025-03-14) 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 1 previous error

For more information about this error, try `rustc --explain E0658`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.F-where_clause_attrs`#![feature(where_clause_attrs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.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