rust-lang / rust-lang/rust

ICE: `could not resolve upvar: LocalVarId(HirId(DefId)))`

Open
#125,553 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug F-type_alias_impl_trait I-ICE S-bug-has-test T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

auto-reduced (treereduce-rust):




#[derive(Copy, Clone)]
struct Foo((u32, u32));

fn main() {
    type T = impl Copy(Copy, Clone)
    let foo: T = Foo((1u32, 1u32));
    let x = move || {
        let derive = move || {
        let Foo((a, b)) = foo;
    };
    };
}


original:

#![feature(type_alias_impl_trait)]
// check-pass

#[derive(Copy, Clone)]
struct Foo((u32, u32));

fn main() {
    type T = impl Copy(Copy, Clone)
    let foo: T = Foo((1u32, 1u32));
    let x = move || {
        let derive = move || {
        let Foo((a, b)) = foo;
    };
    };
}

Version information

rustc 1.80.0-nightly (48f00110d 2024-05-25)
binary: rustc
commit-hash: 48f00110d0dae38b3046a9ac05d20ea321fd6637
commit-date: 2024-05-25
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zunstable-options --edition=2024

Program output

error: expected `;`, found keyword `let`
 --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:8:36
  |
8 |     type T = impl Copy(Copy, Clone)
  |                                    ^ help: add `;` here
9 |     let foo: T = Foo((1u32, 1u32));
  |     --- unexpected token

error[E0658]: `impl Trait` in type aliases is unstable
 --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:8:14
  |
8 |     type T = impl Copy(Copy, Clone)
  |              ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
  = note: this compiler was built on 2024-05-25; consider upgrading it if it is out of date

error[E0658]: parenthetical notation is only stable when used with `Fn`-family traits
 --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:8:19
  |
8 |     type T = impl Copy(Copy, Clone)
  |                   ^^^^^^^^^^^^^^^^^
  |
  = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
  = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
  = note: this compiler was built on 2024-05-25; consider upgrading it if it is out of date

error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
   --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:8:19
    |
8   |     type T = impl Copy(Copy, Clone)
    |                   ^^^^------------- help: remove these parenthetical generics
    |                   |
    |                   expected 0 generic arguments
    |
note: trait defined here, with 0 generic parameters
   --> /home/matthias/.rustup/toolchains/master/lib/rustlib/src/rust/library/core/src/marker.rs:403:11
    |
403 | pub trait Copy: Clone {
    |           ^^^^

error[E0220]: associated type `Output` not found for `Copy`
 --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:8:19
  |
8 |     type T = impl Copy(Copy, Clone)
  |                   ^^^^^^^^^^^^^^^^^ associated type `Output` not found

warning: unused variable: `x`
  --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:10:9
   |
10 |     let x = move || {
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `derive`
  --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:11:13
   |
11 |         let derive = move || {
   |             ^^^^^^ help: if this is intentional, prefix it with an underscore: `_derive`

error: internal compiler error: compiler/rustc_mir_build/src/build/expr/as_place.rs:261:67: could not resolve upvar: LocalVarId(HirId(DefId(0:3 ~ mvce[1e61]::main).12)) + []
 --> /tmp/icemaker_global_tempdir.pVDSzVqNCAi1/rustc_testrunner_tmpdir_reporting.D58DI9yV6pRc/mvce.rs:9:9
  |
9 |     let foo: T = Foo((1u32, 1u32));
  |         ^^^

thread 'rustc' panicked at compiler/rustc_mir_build/src/build/expr/as_place.rs:261:67:
Box<dyn Any>
stack backtrace:
   0:     0x78e613a5f075 - std::backtrace_rs::backtrace::libunwind::trace::h42aea1e7bd0a8d0f
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x78e613a5f075 - std::backtrace_rs::backtrace::trace_unsynchronized::hf3ac14f94797a8ff
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x78e613a5f075 - std::sys_common::backtrace::_print_fmt::hfdeb6f5ed3f5afaa
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x78e613a5f075 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3a3bab3a7e07f684
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x78e613aae18b - core::fmt::rt::Argument::fmt::h827eaf91b0235e22
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/core/src/fmt/rt.rs:165:63
   5:     0x78e613aae18b - core::fmt::write::h3c9de6e4b056660b
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/core/src/fmt/mod.rs:1172:21
   6:     0x78e613a53dcf - std::io::Write::write_fmt::h4989c38cc46ac4a9
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/io/mod.rs:1835:15
   7:     0x78e613a5ee4e - std::sys_common::backtrace::_print::hf88b29e9f4397d20
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x78e613a5ee4e - std::sys_common::backtrace::print::ha9d7657d2fccb9ae
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x78e613a61879 - std::panicking::default_hook::{{closure}}::hc05689f1cbee5d27
  10:     0x78e613a6161a - std::panicking::default_hook::hd873922dd239ed0b
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/panicking.rs:298:9
  11:     0x78e6104f9eef - std[f497e4f3b89fc98e]::panicking::update_hook::<alloc[98811ad6430038c6]::boxed::Box<rustc_driver_impl[54b05657baa3450f]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x78e613a61fab - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf701087af7d36f49
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/alloc/src/boxed.rs:2077:9
  13:     0x78e613a61fab - std::panicking::rust_panic_with_hook::haff0763df51daf39
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/panicking.rs:799:13
  14:     0x78e610529e34 - std[f497e4f3b89fc98e]::panicking::begin_panic::<rustc_errors[6fa0d106617ae6b1]::ExplicitBug>::{closure#0}
  15:     0x78e610526be6 - std[f497e4f3b89fc98e]::sys_common::backtrace::__rust_end_short_backtrace::<std[f497e4f3b89fc98e]::panicking::begin_panic<rustc_errors[6fa0d106617ae6b1]::ExplicitBug>::{closure#0}, !>
  16:     0x78e6105268c6 - std[f497e4f3b89fc98e]::panicking::begin_panic::<rustc_errors[6fa0d106617ae6b1]::ExplicitBug>
  17:     0x78e6105333d1 - <rustc_errors[6fa0d106617ae6b1]::diagnostic::BugAbort as rustc_errors[6fa0d106617ae6b1]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x78e610a32048 - <rustc_errors[6fa0d106617ae6b1]::DiagCtxt>::span_bug::<rustc_span[f743e6227e8610a7]::span_encoding::Span, alloc[98811ad6430038c6]::string::String>
  19:     0x78e610a4529d - rustc_middle[8d1200f20c5736b5]::util::bug::opt_span_bug_fmt::<rustc_span[f743e6227e8610a7]::span_encoding::Span>::{closure#0}
  20:     0x78e610a453ea - rustc_middle[8d1200f20c5736b5]::ty::context::tls::with_opt::<rustc_middle[8d1200f20c5736b5]::util::bug::opt_span_bug_fmt<rustc_span[f743e6227e8610a7]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x78e610a3f95b - rustc_middle[8d1200f20c5736b5]::ty::context::tls::with_context_opt::<rustc_middle[8d1200f20c5736b5]::ty::context::tls::with_opt<rustc_middle[8d1200f20c5736b5]::util::bug::opt_span_bug_fmt<rustc_span[f743e6227e8610a7]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x78e60feccb97 - rustc_middle[8d1200f20c5736b5]::util::bug::span_bug_fmt::<rustc_span[f743e6227e8610a7]::span_encoding::Span>
  23:     0x78e6124ebd95 - <rustc_mir_build[754463169855fb8d]::build::expr::as_place::PlaceBuilder>::to_place
  24:     0x78e611b739bd - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_into_dest
  25:     0x78e611b76429 - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_into_dest
  26:     0x78e611b6b5aa - <rustc_mir_build[754463169855fb8d]::build::Builder>::as_temp::{closure#0}
  27:     0x78e611b704ef - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_as_place
  28:     0x78e611b71376 - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_as_place
  29:     0x78e611b71376 - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_as_place
  30:     0x78e611b6938f - <rustc_mir_build[754463169855fb8d]::build::Builder>::as_rvalue
  31:     0x78e611b72d3a - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_into_dest
  32:     0x78e611b74d32 - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_into_dest
  33:     0x78e612332a97 - <rustc_mir_build[754463169855fb8d]::build::Builder>::ast_block_stmts
  34:     0x78e612331ba3 - <rustc_mir_build[754463169855fb8d]::build::Builder>::ast_block
  35:     0x78e611b73928 - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_into_dest
  36:     0x78e611b74d32 - <rustc_mir_build[754463169855fb8d]::build::Builder>::expr_into_dest
  37:     0x78e611b4aaf2 - rustc_mir_build[754463169855fb8d]::build::mir_build
  38:     0x78e611b489ce - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>
  39:     0x78e611bafa71 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  40:     0x78e611baf58d - rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  41:     0x78e612056bb0 - rustc_mir_transform[4b7e7caadf877c4f]::ffi_unwind_calls::has_ffi_unwind_calls
  42:     0x78e612056665 - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::has_ffi_unwind_calls::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>
  43:     0x78e612055dd1 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  44:     0x78e6120559c1 - rustc_query_impl[f809864b4f0d0f3d]::query_impl::has_ffi_unwind_calls::get_query_non_incr::__rust_end_short_backtrace
  45:     0x78e60f52122c - rustc_mir_transform[4b7e7caadf877c4f]::mir_promoted
  46:     0x78e611b32a60 - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 16usize]>>
  47:     0x78e611b32d36 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  48:     0x78e6126b3a10 - rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  49:     0x78e6126b3b07 - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>
  50:     0x78e611bafa71 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  51:     0x78e611baf4cd - rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  52:     0x78e61238be44 - rustc_middle[8d1200f20c5736b5]::query::plumbing::query_get_at::<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>>
  53:     0x78e61238bea2 - <rustc_borrowck[f91edfc9996d4553]::type_check::TypeChecker>::prove_closure_bounds
  54:     0x78e611adebf8 - <rustc_borrowck[f91edfc9996d4553]::type_check::TypeChecker>::typeck_mir
  55:     0x78e60ef719db - rustc_borrowck[f91edfc9996d4553]::type_check::type_check
  56:     0x78e60ef2a9f7 - rustc_borrowck[f91edfc9996d4553]::nll::compute_regions
  57:     0x78e6126c15eb - rustc_borrowck[f91edfc9996d4553]::do_mir_borrowck
  58:     0x78e6126b3bbe - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>
  59:     0x78e611bafa71 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  60:     0x78e611baf4cd - rustc_query_impl[f809864b4f0d0f3d]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  61:     0x78e6121e62af - rustc_middle[8d1200f20c5736b5]::query::plumbing::query_get_at::<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_span[f743e6227e8610a7]::def_id::LocalDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>>
  62:     0x78e61065f808 - <rustc_hir_analysis[773f5f9066629b08]::collect::type_of::opaque::TaitConstraintLocator>::check
  63:     0x78e6124f4874 - rustc_hir_analysis[773f5f9066629b08]::collect::type_of::type_of_opaque
  64:     0x78e6124f402f - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>
  65:     0x78e611942b1e - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::DefIdCache<rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  66:     0x78e612783704 - rustc_query_impl[f809864b4f0d0f3d]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  67:     0x78e6119414bc - rustc_middle[8d1200f20c5736b5]::query::plumbing::query_get_at::<rustc_query_system[7155d4f1ed1184a2]::query::caches::DefIdCache<rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>>
  68:     0x78e60f433011 - rustc_hir_analysis[773f5f9066629b08]::collect::type_of::type_of
  69:     0x78e611943eea - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>
  70:     0x78e611942b1e - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::DefIdCache<rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  71:     0x78e6119426e7 - rustc_query_impl[f809864b4f0d0f3d]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  72:     0x78e6119414bc - rustc_middle[8d1200f20c5736b5]::query::plumbing::query_get_at::<rustc_query_system[7155d4f1ed1184a2]::query::caches::DefIdCache<rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 8usize]>>>
  73:     0x78e612726b8c - rustc_hir_analysis[773f5f9066629b08]::check::check::check_item_type
  74:     0x78e611e42add - rustc_hir_analysis[773f5f9066629b08]::check::wfcheck::check_well_formed
  75:     0x78e611e415d1 - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>
  76:     0x78e611e40d66 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::VecCache<rustc_hir[33912c6b90d9b84e]::hir_id::OwnerId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  77:     0x78e611e40ae4 - rustc_query_impl[f809864b4f0d0f3d]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  78:     0x78e611e3e9b7 - rustc_hir_analysis[773f5f9066629b08]::check::wfcheck::check_mod_type_wf
  79:     0x78e611e3e7e1 - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>
  80:     0x78e61252e6fa - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::DefaultCache<rustc_span[f743e6227e8610a7]::def_id::LocalModDefId, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  81:     0x78e61252e4b5 - rustc_query_impl[f809864b4f0d0f3d]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  82:     0x78e611bac88c - rustc_hir_analysis[773f5f9066629b08]::check_crate
  83:     0x78e611b8d07e - rustc_interface[58067e46342fbaaa]::passes::analysis
  84:     0x78e611b8cbd5 - rustc_query_impl[f809864b4f0d0f3d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f809864b4f0d0f3d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>
  85:     0x78e6125553a5 - rustc_query_system[7155d4f1ed1184a2]::query::plumbing::try_execute_query::<rustc_query_impl[f809864b4f0d0f3d]::DynamicConfig<rustc_query_system[7155d4f1ed1184a2]::query::caches::SingleCache<rustc_middle[8d1200f20c5736b5]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[f809864b4f0d0f3d]::plumbing::QueryCtxt, false>
  86:     0x78e61255510f - rustc_query_impl[f809864b4f0d0f3d]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  87:     0x78e6123cac5c - rustc_interface[58067e46342fbaaa]::interface::run_compiler::<core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>, rustc_driver_impl[54b05657baa3450f]::run_compiler::{closure#0}>::{closure#1}
  88:     0x78e6123b6d09 - std[f497e4f3b89fc98e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[58067e46342fbaaa]::util::run_in_thread_with_globals<rustc_interface[58067e46342fbaaa]::util::run_in_thread_pool_with_globals<rustc_interface[58067e46342fbaaa]::interface::run_compiler<core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>, rustc_driver_impl[54b05657baa3450f]::run_compiler::{closure#0}>::{closure#1}, core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>>::{closure#0}, core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>>
  89:     0x78e6123b6ac8 - <<std[f497e4f3b89fc98e]::thread::Builder>::spawn_unchecked_<rustc_interface[58067e46342fbaaa]::util::run_in_thread_with_globals<rustc_interface[58067e46342fbaaa]::util::run_in_thread_pool_with_globals<rustc_interface[58067e46342fbaaa]::interface::run_compiler<core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>, rustc_driver_impl[54b05657baa3450f]::run_compiler::{closure#0}>::{closure#1}, core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>>::{closure#0}, core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e093d3f8342b0aab]::result::Result<(), rustc_span[f743e6227e8610a7]::ErrorGuaranteed>>::{closure#2} as core[e093d3f8342b0aab]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  90:     0x78e613a6bd8b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h07c51d08fbe7b366
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/alloc/src/boxed.rs:2063:9
  91:     0x78e613a6bd8b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h59743c0df790be85
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/alloc/src/boxed.rs:2063:9
  92:     0x78e613a6bd8b - std::sys::pal::unix::thread::Thread::new::thread_start::h35133497d39238f8
                               at /rustc/48f00110d0dae38b3046a9ac05d20ea321fd6637/library/std/src/sys/pal/unix/thread.rs:108:17
  93:     0x78e60d2aa1cf - <unknown>
  94:     0x78e60d32b6ec - <unknown>
  95:                0x0 - <unknown>

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.80.0-nightly (48f00110d 2024-05-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options -Z dump-mir-dir=dir

query stack during panic:
#0 [mir_built] building MIR for `main::{closure#0}`
#1 [has_ffi_unwind_calls] checking if `main::{closure#0}` contains FFI-unwind calls
end of query stack
error: aborting due to 6 previous errors; 2 warnings emitted

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

@rustbot label +F-type_alias_impl_trait

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the ICE with the reduced upvar.rs example using the shown rustc command and inspect compiler/rustc_mir_build/src/build/expr/as_place.rs around line 261. Trace how the nested move closures and type alias impl Trait reach upvar resolution; done means this input no longer causes an internal compiler error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.