Skip to content

ICE: not yet implemented: Expr #143128

Closed
@matthiaskrgr

Description

@matthiaskrgr

snippet:

fn main() { | b : [str; _] | }

Version information

rustc 1.90.0-nightly (d41e12f1f 2025-06-27)
binary: rustc
commit-hash: d41e12f1f4e4884c356f319b881921aa37040de5
commit-date: 2025-06-27
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7

Possibly related line of code:

Node::Item(it) => it.kind.descr(),
Node::ImplItem(it) => it.kind.descr(),
Node::TraitItem(it) => it.kind.descr(),
Node::ForeignItem(it) => it.kind.descr(),
Node::OpaqueTy(_) => "opaque type",
Node::Synthetic => self.tcx.def_descr(kind_id.into()),
node => todo!("{node:#?}"),
};
let mut diag = placeholder_type_error_diag(
self,
generics,
placeholder_types,
infer_replacements.iter().map(|&(span, _)| span).collect(),

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

Program output

error: expected expression, found `}`
 --> /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:30
  |
1 | fn main() { | b : [str; _] | }
  |             ---------------- ^ expected expression
  |             |
  |             while parsing the body of this closure
  |
help: you might have meant to open the body of the closure, instead of enclosing the closure in a block
  |
1 - fn main() { | b : [str; _] | }
1 + fn main()  | b : [str; _] | { }
  |


thread 'rustc' panicked at compiler/rustc_hir_analysis/src/collect.rs:289:21:
not yet implemented: Expr(
    Expr {
        hir_id: HirId(DefId(0:3 ~ mvce[f6e2]::main).2),
        kind: Closure(
            Closure {
                def_id: DefId(0:4 ~ mvce[f6e2]::main::{closure#0}),
                binder: Default,
                constness: NotConst,
                capture_clause: Ref,
                bound_generic_params: [],
                fn_decl: FnDecl {
                    inputs: [
                        Ty {
                            hir_id: HirId(DefId(0:3 ~ mvce[f6e2]::main).9),
                            span: /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:19: 1:27 (#0),
                            kind: Array(
                                Ty {
                                    hir_id: HirId(DefId(0:3 ~ mvce[f6e2]::main).6),
                                    span: /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:20: 1:23 (#0),
                                    kind: Path(
                                        Resolved(
                                            None,
                                            Path {
                                                span: /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:20: 1:23 (#0),
                                                res: PrimTy(
                                                    Str,
                                                ),
                                                segments: [
                                                    PathSegment {
                                                        ident: str#0,
                                                        hir_id: HirId(DefId(0:3 ~ mvce[f6e2]::main).7),
                                                        res: PrimTy(
                                                            Str,
                                                        ),
                                                        args: None,
                                                        infer_args: false,
                                                    },
                                                ],
                                            },
                                        ),
                                    ),
                                },
                                ConstArg {
                                    hir_id: HirId(DefId(0:3 ~ mvce[f6e2]::main).8),
                                    kind: Infer(
                                        /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:25: 1:26 (#0),
                                        (),
                                    ),
                                },
                            ),
                        },
                    ],
                    output: DefaultReturn(
                        /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:29: 1:29 (#0),
                    ),
                    c_variadic: false,
                    implicit_self: None,
                    lifetime_elision_allowed: false,
                },
                body: BodyId {
                    hir_id: HirId(DefId(0:3 ~ mvce[f6e2]::main).5),
                },
                fn_decl_span: /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:13: 1:29 (#0),
                fn_arg_span: Some(
                    /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:13: 1:29 (#0),
                ),
                kind: Closure,
            },
        ),
        span: /tmp/icemaker_global_tempdir.lMH2wbicz6SK/rustc_testrunner_tmpdir_reporting.qLTNNlSm7y6r/mvce.rs:1:13: 1:31 (#0),
    },
)
stack backtrace:
   0:     0x7da6ec70b8f3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hebd9fa5baa76cf43
   1:     0x7da6ece02bb7 - core::fmt::write::h429a00c73b7bd916
   2:     0x7da6ec701583 - std::io::Write::write_fmt::h6d4f62c05e65ac59
   3:     0x7da6ec70b752 - std::sys::backtrace::BacktraceLock::print::h1cecab39fb1fb93e
   4:     0x7da6ec70f24a - std::panicking::default_hook::{{closure}}::h29a806fb9147c131
   5:     0x7da6ec70edcf - std::panicking::default_hook::h593716ddd0753119
   6:     0x7da6eb7e9e83 - std[2be0445af3f93c0d]::panicking::update_hook::<alloc[488ae37708fb67a2]::boxed::Box<rustc_driver_impl[ebf4c2b9c075f037]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7da6ec70fa9b - std::panicking::rust_panic_with_hook::hfc4b3ab3959cfb53
   8:     0x7da6ec70f79a - std::panicking::begin_panic_handler::{{closure}}::h5f57ea81ecf988b9
   9:     0x7da6ec70bdb9 - std::sys::backtrace::__rust_end_short_backtrace::h67b431be25971952
  10:     0x7da6ec70f47d - __rustc[666c16e121064983]::rust_begin_unwind
  11:     0x7da6e8e9dd40 - core::panicking::panic_fmt::ha1cad36c20705841
  12:     0x7da6eb998597 - <rustc_hir_analysis[8affc97354c40bbf]::collect::ItemCtxt>::report_placeholder_type_error
  13:     0x7da6eb998a1a - <rustc_hir_analysis[8affc97354c40bbf]::collect::ItemCtxt as rustc_hir_analysis[8affc97354c40bbf]::hir_ty_lowering::HirTyLowerer>::ct_infer
  14:     0x7da6ed7213cb - <dyn rustc_hir_analysis[8affc97354c40bbf]::hir_ty_lowering::HirTyLowerer>::lower_const_arg
  15:     0x7da6ed70ff14 - <dyn rustc_hir_analysis[8affc97354c40bbf]::hir_ty_lowering::HirTyLowerer>::lower_ty
  16:     0x7da6eb9ba698 - <rustc_hir_analysis[8affc97354c40bbf]::hir_wf_check::diagnostic_hir_wf_check::HirWfCheck as rustc_hir[a7bbf9f8b7a383b4]::intravisit::Visitor>::visit_ty
  17:     0x7da6eb9b9f82 - rustc_hir_analysis[8affc97354c40bbf]::hir_wf_check::diagnostic_hir_wf_check
  18:     0x7da6ec1f797f - rustc_query_impl[104ed5fe1c5195e2]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[104ed5fe1c5195e2]::query_impl::diagnostic_hir_wf_check::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c01a8670a808a889]::query::erase::Erased<[u8; 8usize]>>
  19:     0x7da6ec1ce0e3 - <rustc_query_impl[104ed5fe1c5195e2]::query_impl::diagnostic_hir_wf_check::dynamic_query::{closure#2} as core[555f998544236290]::ops::function::FnOnce<(rustc_middle[c01a8670a808a889]::ty::context::TyCtxt, (rustc_middle[c01a8670a808a889]::ty::predicate::Predicate, rustc_middle[c01a8670a808a889]::traits::WellFormedLoc))>>::call_once
  20:     0x7da6ec13b0d6 - rustc_query_system[84f7107e096ccb8a]::query::plumbing::try_execute_query::<rustc_query_impl[104ed5fe1c5195e2]::DynamicConfig<rustc_query_system[84f7107e096ccb8a]::query::caches::DefaultCache<(rustc_middle[c01a8670a808a889]::ty::predicate::Predicate, rustc_middle[c01a8670a808a889]::traits::WellFormedLoc), rustc_middle[c01a8670a808a889]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[104ed5fe1c5195e2]::plumbing::QueryCtxt, false>
  21:     0x7da6ec233847 - rustc_query_impl[104ed5fe1c5195e2]::query_impl::diagnostic_hir_wf_check::get_query_non_incr::__rust_end_short_backtrace
  22:     0x7da6ec52dc19 - <rustc_trait_selection[2e3c3a3418ff9c14]::error_reporting::TypeErrCtxt>::report_selection_error
  23:     0x7da6ec58d44d - <rustc_trait_selection[2e3c3a3418ff9c14]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
  24:     0x7da6ecebfa28 - <rustc_hir_typeck[75e4b00319747bc3]::fn_ctxt::FnCtxt>::try_structurally_resolve_type
  25:     0x7da6ed8a60e2 - <rustc_hir_typeck[75e4b00319747bc3]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26:     0x7da6ed872c0c - <rustc_hir_typeck[75e4b00319747bc3]::fn_ctxt::FnCtxt>::check_expr_block
  27:     0x7da6ed8a747b - <rustc_hir_typeck[75e4b00319747bc3]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7da6ed87d520 - rustc_hir_typeck[75e4b00319747bc3]::check::check_fn
  29:     0x7da6ee020b12 - rustc_hir_typeck[75e4b00319747bc3]::typeck_with_inspect::{closure#0}
  30:     0x7da6ee00d630 - rustc_query_impl[104ed5fe1c5195e2]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[104ed5fe1c5195e2]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c01a8670a808a889]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7da6ed00bb6e - rustc_query_system[84f7107e096ccb8a]::query::plumbing::try_execute_query::<rustc_query_impl[104ed5fe1c5195e2]::DynamicConfig<rustc_data_structures[1398d766453e7b7d]::vec_cache::VecCache<rustc_span[ab4334c9ee9040b8]::def_id::LocalDefId, rustc_middle[c01a8670a808a889]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[84f7107e096ccb8a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[104ed5fe1c5195e2]::plumbing::QueryCtxt, false>
  32:     0x7da6ed00b509 - rustc_query_impl[104ed5fe1c5195e2]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7da6ed0035ed - rustc_hir_analysis[8affc97354c40bbf]::check_crate
  34:     0x7da6ed007659 - rustc_interface[dadf760504f6584b]::passes::analysis
  35:     0x7da6ed007265 - rustc_query_impl[104ed5fe1c5195e2]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[104ed5fe1c5195e2]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c01a8670a808a889]::query::erase::Erased<[u8; 0usize]>>
  36:     0x7da6edeba170 - rustc_query_system[84f7107e096ccb8a]::query::plumbing::try_execute_query::<rustc_query_impl[104ed5fe1c5195e2]::DynamicConfig<rustc_query_system[84f7107e096ccb8a]::query::caches::SingleCache<rustc_middle[c01a8670a808a889]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[104ed5fe1c5195e2]::plumbing::QueryCtxt, false>
  37:     0x7da6edeb9d3c - rustc_query_impl[104ed5fe1c5195e2]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  38:     0x7da6ee064556 - rustc_interface[dadf760504f6584b]::passes::create_and_enter_global_ctxt::<core[555f998544236290]::option::Option<rustc_interface[dadf760504f6584b]::queries::Linker>, rustc_driver_impl[ebf4c2b9c075f037]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  39:     0x7da6ee055c6f - rustc_interface[dadf760504f6584b]::interface::run_compiler::<(), rustc_driver_impl[ebf4c2b9c075f037]::run_compiler::{closure#0}>::{closure#1}
  40:     0x7da6ee035ff8 - std[2be0445af3f93c0d]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[dadf760504f6584b]::util::run_in_thread_with_globals<rustc_interface[dadf760504f6584b]::util::run_in_thread_pool_with_globals<rustc_interface[dadf760504f6584b]::interface::run_compiler<(), rustc_driver_impl[ebf4c2b9c075f037]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  41:     0x7da6ee035cd6 - <<std[2be0445af3f93c0d]::thread::Builder>::spawn_unchecked_<rustc_interface[dadf760504f6584b]::util::run_in_thread_with_globals<rustc_interface[dadf760504f6584b]::util::run_in_thread_pool_with_globals<rustc_interface[dadf760504f6584b]::interface::run_compiler<(), rustc_driver_impl[ebf4c2b9c075f037]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[555f998544236290]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7da6ee03bf7d - std::sys::pal::unix::thread::Thread::new::thread_start::h5727abaccf4165cd
  43:     0x7da6e7a5f7eb - <unknown>
  44:     0x7da6e7ae318c - <unknown>
  45:                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 (d41e12f1f 2025-06-27) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [diagnostic_hir_wf_check] performing HIR wf-checking for predicate `Binder { value: TraitPredicate(<str as core::marker::Sized>, polarity:Positive), bound_vars: [] }` at item `Param { function: DefId(0:4 ~ mvce[f6e2]::main::{closure#0}), param_idx: 0 }`
#1 [typeck] type-checking `main`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error


Metadata

Metadata

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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