Skip to content

ICE: ast lowering: None #121537

@matthiaskrgr

Description

@matthiaskrgr
Member

snippet:

trait MyTrait {
    #[doc = MyTrait]
    fn myfun();
}

Version information

rustc 1.78.0-nightly (8f359beca 2024-02-23)
binary: rustc
commit-hash: 8f359beca4e58bc3ae795a666301a8f47023044c
commit-date: 2024-02-23
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

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

Program output

thread 'rustc' panicked at compiler/rustc_ast_lowering/src/lib.rs:962:56:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7f51bb58caf6 - std::backtrace_rs::backtrace::libunwind::trace::h4d16db2f784877bc
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f51bb58caf6 - std::backtrace_rs::backtrace::trace_unsynchronized::h584b4a9b0240fa46
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f51bb58caf6 - std::sys_common::backtrace::_print_fmt::hd30229489add2f78
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f51bb58caf6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2c0d00d6b7d69808
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f51bb5dda7c - core::fmt::rt::Argument::fmt::hff9bfb4853f651d7
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/core/src/fmt/rt.rs:142:9
   5:     0x7f51bb5dda7c - core::fmt::write::h3421d3f24b10b162
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f51bb5814bf - std::io::Write::write_fmt::hec18e9e87db322bb
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/io/mod.rs:1846:15
   7:     0x7f51bb58c8a4 - std::sys_common::backtrace::_print::hec336a3777e68e7b
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f51bb58c8a4 - std::sys_common::backtrace::print::hde3a6d5d13170337
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f51bb58f5eb - std::panicking::default_hook::{{closure}}::h4a4905d59aca1811
  10:     0x7f51bb58f339 - std::panicking::default_hook::h33a18ce8d018f6fd
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/panicking.rs:292:9
  11:     0x7f51be48467c - std[d1f7731e2ff5974d]::panicking::update_hook::<alloc[6711342ad6595d8]::boxed::Box<rustc_driver_impl[db1009755931a507]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f51bb58fd50 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h923e5082c0e2f790
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/alloc/src/boxed.rs:2030:9
  13:     0x7f51bb58fd50 - std::panicking::rust_panic_with_hook::he294011ca89c3e63
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/panicking.rs:783:13
  14:     0x7f51bb58fa59 - std::panicking::begin_panic_handler::{{closure}}::hd80de86623d4d7ef
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/panicking.rs:649:13
  15:     0x7f51bb58cfd6 - std::sys_common::backtrace::__rust_end_short_backtrace::h310587e2e5c29372
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f51bb58f7c4 - rust_begin_unwind
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/panicking.rs:645:5
  17:     0x7f51bb5d9f95 - core::panicking::panic_fmt::h275e2499dd810de9
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/core/src/panicking.rs:72:14
  18:     0x7f51bb5da053 - core::panicking::panic::hc7e092584ec9d38c
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/core/src/panicking.rs:144:5
  19:     0x7f51bb5d9d26 - core::option::unwrap_failed::h2d0876c43db0d378
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/core/src/option.rs:1985:5
  20:     0x7f51bf9d53ef - <rustc_ast_lowering[ce393ffbb0c3f2c8]::LoweringContext>::lower_attrs
  21:     0x7f51bfaf11f1 - <rustc_ast_lowering[ce393ffbb0c3f2c8]::LoweringContext>::lower_assoc_item
  22:     0x7f51bfaee2d3 - <rustc_ast_lowering[ce393ffbb0c3f2c8]::item::ItemLowerer>::lower_node
  23:     0x7f51c0841e82 - rustc_ast_lowering[ce393ffbb0c3f2c8]::lower_to_hir
  24:     0x7f51c08415fc - rustc_query_impl[5f3fca9184d705d1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5f3fca9184d705d1]::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 8usize]>>
  25:     0x7f51c059388e - rustc_query_system[3c44b3ad726fdf36]::query::plumbing::try_execute_query::<rustc_query_impl[5f3fca9184d705d1]::DynamicConfig<rustc_query_system[3c44b3ad726fdf36]::query::caches::SingleCache<rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5f3fca9184d705d1]::plumbing::QueryCtxt, false>
  26:     0x7f51c05933e0 - rustc_query_impl[5f3fca9184d705d1]::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7f51bfab91c3 - rustc_query_impl[5f3fca9184d705d1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5f3fca9184d705d1]::query_impl::hir_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 8usize]>>
  28:     0x7f51bfab8723 - rustc_query_system[3c44b3ad726fdf36]::query::plumbing::try_execute_query::<rustc_query_impl[5f3fca9184d705d1]::DynamicConfig<rustc_query_system[3c44b3ad726fdf36]::query::caches::VecCache<rustc_hir[9af8e7cbf4ff6ec9]::hir_id::OwnerId, rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5f3fca9184d705d1]::plumbing::QueryCtxt, false>
  29:     0x7f51bfab8489 - rustc_query_impl[5f3fca9184d705d1]::query_impl::hir_attrs::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7f51bf81a62a - <rustc_middle[10e0138f1f482b76]::hir::map::Map>::attrs
  31:     0x7f51c0808003 - rustc_passes[caae405a59d13605]::entry::entry_fn
  32:     0x7f51c0807f98 - rustc_query_impl[5f3fca9184d705d1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5f3fca9184d705d1]::query_impl::entry_fn::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 12usize]>>
  33:     0x7f51c0807f73 - <rustc_query_impl[5f3fca9184d705d1]::query_impl::entry_fn::dynamic_query::{closure#2} as core[bd87c62ae3a7b4ee]::ops::function::FnOnce<(rustc_middle[10e0138f1f482b76]::ty::context::TyCtxt, ())>>::call_once
  34:     0x7f51c080788a - rustc_query_system[3c44b3ad726fdf36]::query::plumbing::try_execute_query::<rustc_query_impl[5f3fca9184d705d1]::DynamicConfig<rustc_query_system[3c44b3ad726fdf36]::query::caches::SingleCache<rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 12usize]>>, false, false, false>, rustc_query_impl[5f3fca9184d705d1]::plumbing::QueryCtxt, false>
  35:     0x7f51c0807645 - rustc_query_impl[5f3fca9184d705d1]::query_impl::entry_fn::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f51c03edab4 - rustc_interface[94ec20dfe64cdcea]::passes::analysis
  37:     0x7f51c03ed9d9 - rustc_query_impl[5f3fca9184d705d1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5f3fca9184d705d1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 1usize]>>
  38:     0x7f51c0525643 - rustc_query_system[3c44b3ad726fdf36]::query::plumbing::try_execute_query::<rustc_query_impl[5f3fca9184d705d1]::DynamicConfig<rustc_query_system[3c44b3ad726fdf36]::query::caches::SingleCache<rustc_middle[10e0138f1f482b76]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[5f3fca9184d705d1]::plumbing::QueryCtxt, false>
  39:     0x7f51c05253bf - rustc_query_impl[5f3fca9184d705d1]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f51c0534896 - rustc_interface[94ec20dfe64cdcea]::interface::run_compiler::<core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>, rustc_driver_impl[db1009755931a507]::run_compiler::{closure#0}>::{closure#0}
  41:     0x7f51c07caa4d - std[d1f7731e2ff5974d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[94ec20dfe64cdcea]::util::run_in_thread_with_globals<rustc_interface[94ec20dfe64cdcea]::util::run_in_thread_pool_with_globals<rustc_interface[94ec20dfe64cdcea]::interface::run_compiler<core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>, rustc_driver_impl[db1009755931a507]::run_compiler::{closure#0}>::{closure#0}, core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>>::{closure#0}, core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>>
  42:     0x7f51c07ca87a - <<std[d1f7731e2ff5974d]::thread::Builder>::spawn_unchecked_<rustc_interface[94ec20dfe64cdcea]::util::run_in_thread_with_globals<rustc_interface[94ec20dfe64cdcea]::util::run_in_thread_pool_with_globals<rustc_interface[94ec20dfe64cdcea]::interface::run_compiler<core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>, rustc_driver_impl[db1009755931a507]::run_compiler::{closure#0}>::{closure#0}, core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>>::{closure#0}, core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bd87c62ae3a7b4ee]::result::Result<(), rustc_span[6ccc48fe7a4f1f83]::ErrorGuaranteed>>::{closure#1} as core[bd87c62ae3a7b4ee]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  43:     0x7f51bb599725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h11737601996c7bc7
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/alloc/src/boxed.rs:2016:9
  44:     0x7f51bb599725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb64bc4a2c7899523
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/alloc/src/boxed.rs:2016:9
  45:     0x7f51bb599725 - std::sys::pal::unix::thread::Thread::new::thread_start::h9f6bca54366231ee
                               at /rustc/8f359beca4e58bc3ae795a666301a8f47023044c/library/std/src/sys/pal/unix/thread.rs:108:17
  46:     0x7f51bb38055a - <unknown>
  47:     0x7f51bb3fda3c - <unknown>
  48:                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.78.0-nightly (8f359beca 2024-02-23) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [hir_crate] getting the crate HIR
#1 [hir_attrs] getting HIR owner attributes in ``
#2 [entry_fn] looking up the entry function of a crate
#3 [analysis] running analysis passes on this crate
end of query stack

Activity

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 Feb 24, 2024
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Feb 24, 2024
matthiaskrgr

matthiaskrgr commented on Feb 24, 2024

@matthiaskrgr
MemberAuthor

Crashes since #121120 cc @nnethercote

added a commit that references this issue on Feb 24, 2024
removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Feb 25, 2024
nnethercote

nnethercote commented on Feb 25, 2024

@nnethercote
Contributor

For the record: #121120 helped expose a latent bug in AST validation, which #121545 will fix.

jieyouxu

jieyouxu commented on Feb 28, 2024

@jieyouxu
Member

Also (probably the same cause):

trait Foo {
    #[doc=hidden]
    fn foo();
}
matthiaskrgr

matthiaskrgr commented on Mar 4, 2024

@matthiaskrgr
MemberAuthor

This code now causes unbound memory growth after when trying to print the query stack. after
query stack during panic:

rustc 1.78.0-nightly (7606c1396 2024-03-04)

added a commit that references this issue on Mar 16, 2024
79c1e58
added a commit that references this issue on Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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

      Participants

      @matthiaskrgr@nnethercote@saethlin@jieyouxu@rustbot

      Issue actions

        ICE: ast lowering: `None` · Issue #121537 · rust-lang/rust