Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: TAIT issue-96572-unconstrained-upvar.rs with edition=2021 #99363

Closed
matthiaskrgr opened this issue Jul 17, 2022 · 10 comments
Closed

ICE: TAIT issue-96572-unconstrained-upvar.rs with edition=2021 #99363

matthiaskrgr opened this issue Jul 17, 2022 · 10 comments
Assignees
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

./src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-upvar.rs

Code

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

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

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

Meta

rustc --version --verbose:

rustc 1.64.0-nightly (db4135175 2022-07-16)
binary: rustc
commit-hash: db41351753df840773ca628d8daa040e95d00eef
commit-date: 2022-07-16
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6

Error output

rustc ./src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-upvar.rs --edition=2021

<output>
Backtrace

error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ issue_96572_unconstrained_upvar[63a9]::main::T::{opaque#0}), []) for `Field` projection

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/db41351753df840773ca628d8daa040e95d00eef/compiler/rustc_errors/src/lib.rs:1391:9
stack backtrace:
   0:     0x7fbb11ea36a0 - std::backtrace_rs::backtrace::libunwind::trace::h108786a0e039677c
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fbb11ea36a0 - std::backtrace_rs::backtrace::trace_unsynchronized::h39dc00768b923060
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fbb11ea36a0 - std::sys_common::backtrace::_print_fmt::hf4723b9978da0e9b
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fbb11ea36a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h465df58082ebd407
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fbb11efd7ac - core::fmt::write::h839373a07e9f9c1d
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/core/src/fmt/mod.rs:1198:17
   5:     0x7fbb11e94b05 - std::io::Write::write_fmt::h85578af94c6f8bb1
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/io/mod.rs:1672:15
   6:     0x7fbb11ea6371 - std::sys_common::backtrace::_print::hb8be20f5f4af91dc
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fbb11ea6371 - std::sys_common::backtrace::print::ha2b0f460984e55d2
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fbb11ea6371 - std::panicking::default_hook::{{closure}}::h2fdc78d54dc90f06
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/panicking.rs:295:22
   9:     0x7fbb11ea6043 - std::panicking::default_hook::hee4dfd319e3a0c89
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/panicking.rs:314:9
  10:     0x7fbb1274f5b1 - rustc_driver[715d7736e30053d3]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fbb11ea6b46 - std::panicking::rust_panic_with_hook::h96e7a69ebe92304b
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/panicking.rs:702:17
  12:     0x7fbb1376ea61 - std[9817335c0e69941c]::panicking::begin_panic::<rustc_errors[1f6e64de7d5fbfd7]::ExplicitBug>::{closure#0}
  13:     0x7fbb1376bd46 - std[9817335c0e69941c]::sys_common::backtrace::__rust_end_short_backtrace::<std[9817335c0e69941c]::panicking::begin_panic<rustc_errors[1f6e64de7d5fbfd7]::ExplicitBug>::{closure#0}, !>
  14:     0x7fbb137b3ac6 - std[9817335c0e69941c]::panicking::begin_panic::<rustc_errors[1f6e64de7d5fbfd7]::ExplicitBug>
  15:     0x7fbb1376bd06 - std[9817335c0e69941c]::panic::panic_any::<rustc_errors[1f6e64de7d5fbfd7]::ExplicitBug>
  16:     0x7fbb13768c15 - <rustc_errors[1f6e64de7d5fbfd7]::HandlerInner>::bug::<&alloc[8dcb00a6567273ec]::string::String>
  17:     0x7fbb13768970 - <rustc_errors[1f6e64de7d5fbfd7]::Handler>::bug::<&alloc[8dcb00a6567273ec]::string::String>
  18:     0x7fbb1382426d - rustc_middle[9fa4ad7581e22bb0]::ty::context::tls::with_context_opt::<rustc_middle[9fa4ad7581e22bb0]::ty::context::tls::with_opt<rustc_middle[9fa4ad7581e22bb0]::util::bug::opt_span_bug_fmt<rustc_span[2cde9445e4382002]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7fbb1382a206 - rustc_middle[9fa4ad7581e22bb0]::util::bug::opt_span_bug_fmt::<rustc_span[2cde9445e4382002]::span_encoding::Span>
  20:     0x7fbb1382a183 - rustc_middle[9fa4ad7581e22bb0]::util::bug::bug_fmt
  21:     0x7fbb15180741 - <&mut rustc_middle[9fa4ad7581e22bb0]::ty::closure::symbols_for_closure_captures::{closure#0} as core[9425a7bf32f2deb6]::ops::function::FnOnce<(&rustc_middle[9fa4ad7581e22bb0]::ty::closure::CapturedPlace,)>>::call_once
  22:     0x7fbb1519410f - <alloc[8dcb00a6567273ec]::vec::Vec<rustc_span[2cde9445e4382002]::symbol::Symbol> as alloc[8dcb00a6567273ec]::vec::spec_from_iter::SpecFromIter<rustc_span[2cde9445e4382002]::symbol::Symbol, core[9425a7bf32f2deb6]::iter::adapters::map::Map<core[9425a7bf32f2deb6]::iter::adapters::flatten::Flatten<core[9425a7bf32f2deb6]::option::IntoIter<core[9425a7bf32f2deb6]::iter::adapters::flatten::FlatMap<indexmap[9e6fb521ba731c74]::map::Values<rustc_hir[2c77287d5d3a5b48]::hir_id::HirId, alloc[8dcb00a6567273ec]::vec::Vec<rustc_middle[9fa4ad7581e22bb0]::ty::closure::CapturedPlace>>, core[9425a7bf32f2deb6]::slice::iter::Iter<rustc_middle[9fa4ad7581e22bb0]::ty::closure::CapturedPlace>, <rustc_middle[9fa4ad7581e22bb0]::ty::context::TypeckResults>::closure_min_captures_flattened::{closure#0}::{closure#0}>>>, rustc_middle[9fa4ad7581e22bb0]::ty::closure::symbols_for_closure_captures::{closure#0}>>>::from_iter
  23:     0x7fbb15180f83 - rustc_middle[9fa4ad7581e22bb0]::ty::closure::symbols_for_closure_captures
  24:     0x7fbb14f23cd9 - rustc_query_system[e0f0f578a6536c76]::query::plumbing::get_query::<rustc_query_impl[7a3910e5d8bfad5a]::queries::symbols_for_closure_captures, rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt>
  25:     0x7fbb14e69227 - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::symbols_for_closure_captures
  26:     0x7fbb13f607c8 - rustc_mir_build[9e129e9db8d9a8a5]::build::construct_fn::<core[9425a7bf32f2deb6]::iter::adapters::chain::Chain<alloc[8dcb00a6567273ec]::vec::into_iter::IntoIter<rustc_mir_build[9e129e9db8d9a8a5]::build::ArgInfo>, core[9425a7bf32f2deb6]::iter::adapters::map::Map<core[9425a7bf32f2deb6]::iter::adapters::enumerate::Enumerate<core[9425a7bf32f2deb6]::slice::iter::Iter<rustc_hir[2c77287d5d3a5b48]::hir::Param>>, rustc_mir_build[9e129e9db8d9a8a5]::build::mir_build::{closure#1}::{closure#1}>>>
  27:     0x7fbb13f99bff - <rustc_infer[d1de4d75abc3b38f]::infer::InferCtxtBuilder>::enter::<rustc_middle[9fa4ad7581e22bb0]::mir::Body, rustc_mir_build[9e129e9db8d9a8a5]::build::mir_build::{closure#1}>
  28:     0x7fbb13f5df7a - rustc_mir_build[9e129e9db8d9a8a5]::build::mir_built
  29:     0x7fbb1431a7ed - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<rustc_middle[9fa4ad7581e22bb0]::ty::WithOptConstParam<rustc_span[2cde9445e4382002]::def_id::LocalDefId>, &rustc_data_structures[7ef9467246fd84c7]::steal::Steal<rustc_middle[9fa4ad7581e22bb0]::mir::Body>>>
  30:     0x7fbb142fe1c5 - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::mir_built
  31:     0x7fbb13c326d3 - rustc_mir_transform[c9ea3109e427812b]::check_unsafety::unsafety_check_result
  32:     0x7fbb13c2e0de - <rustc_mir_transform[c9ea3109e427812b]::check_unsafety::provide::{closure#0} as core[9425a7bf32f2deb6]::ops::function::FnOnce<(rustc_middle[9fa4ad7581e22bb0]::ty::context::TyCtxt, rustc_span[2cde9445e4382002]::def_id::LocalDefId)>>::call_once
  33:     0x7fbb14327b4f - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<rustc_span[2cde9445e4382002]::def_id::LocalDefId, &rustc_middle[9fa4ad7581e22bb0]::mir::query::UnsafetyCheckResult>>
  34:     0x7fbb142ff59e - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::unsafety_check_result
  35:     0x7fbb13c35fcd - rustc_mir_transform[c9ea3109e427812b]::check_unsafety::unsafety_check_result
  36:     0x7fbb13c2e0de - <rustc_mir_transform[c9ea3109e427812b]::check_unsafety::provide::{closure#0} as core[9425a7bf32f2deb6]::ops::function::FnOnce<(rustc_middle[9fa4ad7581e22bb0]::ty::context::TyCtxt, rustc_span[2cde9445e4382002]::def_id::LocalDefId)>>::call_once
  37:     0x7fbb14327b4f - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<rustc_span[2cde9445e4382002]::def_id::LocalDefId, &rustc_middle[9fa4ad7581e22bb0]::mir::query::UnsafetyCheckResult>>
  38:     0x7fbb142ff59e - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::unsafety_check_result
  39:     0x7fbb13c13670 - rustc_mir_transform[c9ea3109e427812b]::mir_const
  40:     0x7fbb1431a7ed - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<rustc_middle[9fa4ad7581e22bb0]::ty::WithOptConstParam<rustc_span[2cde9445e4382002]::def_id::LocalDefId>, &rustc_data_structures[7ef9467246fd84c7]::steal::Steal<rustc_middle[9fa4ad7581e22bb0]::mir::Body>>>
  41:     0x7fbb142fe2fc - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::mir_const
  42:     0x7fbb13c155ea - rustc_mir_transform[c9ea3109e427812b]::mir_promoted
  43:     0x7fbb1434b4ae - rustc_query_system[e0f0f578a6536c76]::query::plumbing::get_query::<rustc_query_impl[7a3910e5d8bfad5a]::queries::mir_promoted, rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt>
  44:     0x7fbb142fe7e7 - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::mir_promoted
  45:     0x7fbb1409f311 - rustc_borrowck[8f524994b73f2421]::mir_borrowck
  46:     0x7fbb1409edfe - <rustc_borrowck[8f524994b73f2421]::provide::{closure#0} as core[9425a7bf32f2deb6]::ops::function::FnOnce<(rustc_middle[9fa4ad7581e22bb0]::ty::context::TyCtxt, rustc_span[2cde9445e4382002]::def_id::LocalDefId)>>::call_once
  47:     0x7fbb14326b10 - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<rustc_span[2cde9445e4382002]::def_id::LocalDefId, &rustc_middle[9fa4ad7581e22bb0]::mir::query::BorrowCheckResult>>
  48:     0x7fbb142ffbfa - <rustc_query_impl[7a3910e5d8bfad5a]::Queries as rustc_middle[9fa4ad7581e22bb0]::ty::query::QueryEngine>::mir_borrowck
  49:     0x7fbb12a7b8cd - <rustc_typeck[f37e8cfc095cc297]::collect::type_of::find_opaque_ty_constraints::ConstraintLocator>::check
  50:     0x7fbb12a7b4e8 - <rustc_typeck[f37e8cfc095cc297]::collect::type_of::find_opaque_ty_constraints::ConstraintLocator as rustc_hir[2c77287d5d3a5b48]::intravisit::Visitor>::visit_item
  51:     0x7fbb12a7b343 - rustc_typeck[f37e8cfc095cc297]::collect::type_of::find_opaque_ty_constraints
  52:     0x7fbb13d5fb3e - rustc_typeck[f37e8cfc095cc297]::collect::type_of::type_of
  53:     0x7fbb14386f38 - rustc_query_system[e0f0f578a6536c76]::query::plumbing::get_query::<rustc_query_impl[7a3910e5d8bfad5a]::queries::type_of, rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt>
  54:     0x7fbb13d4bb8b - rustc_typeck[f37e8cfc095cc297]::check::check::check_item_type
  55:     0x7fbb13d51f6e - rustc_typeck[f37e8cfc095cc297]::check::check::check_mod_item_types
  56:     0x7fbb14329beb - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<rustc_span[2cde9445e4382002]::def_id::LocalDefId, ()>>
  57:     0x7fbb14f0f903 - rustc_query_system[e0f0f578a6536c76]::query::plumbing::get_query::<rustc_query_impl[7a3910e5d8bfad5a]::queries::check_mod_item_types, rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt>
  58:     0x7fbb14c1c42f - <rustc_middle[9fa4ad7581e22bb0]::hir::map::Map>::for_each_module::<rustc_typeck[f37e8cfc095cc297]::check_crate::{closure#6}::{closure#0}>
  59:     0x7fbb14c4916d - rustc_typeck[f37e8cfc095cc297]::check_crate
  60:     0x7fbb14975057 - rustc_interface[8e97ba9879e69f8a]::passes::analysis
  61:     0x7fbb14ed01b5 - rustc_query_system[e0f0f578a6536c76]::query::plumbing::try_execute_query::<rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt, rustc_query_system[e0f0f578a6536c76]::query::caches::DefaultCache<(), core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>>
  62:     0x7fbb14f2e48e - rustc_query_system[e0f0f578a6536c76]::query::plumbing::get_query::<rustc_query_impl[7a3910e5d8bfad5a]::queries::analysis, rustc_query_impl[7a3910e5d8bfad5a]::plumbing::QueryCtxt>
  63:     0x7fbb1494e3fe - <rustc_interface[8e97ba9879e69f8a]::passes::QueryContext>::enter::<rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>
  64:     0x7fbb14931e9e - <rustc_interface[8e97ba9879e69f8a]::interface::Compiler>::enter::<rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}::{closure#2}, core[9425a7bf32f2deb6]::result::Result<core[9425a7bf32f2deb6]::option::Option<rustc_interface[8e97ba9879e69f8a]::queries::Linker>, rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>
  65:     0x7fbb1492dfdf - rustc_span[2cde9445e4382002]::with_source_map::<core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>, rustc_interface[8e97ba9879e69f8a]::interface::create_compiler_and_run<core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>, rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}>::{closure#1}>
  66:     0x7fbb1494a450 - rustc_interface[8e97ba9879e69f8a]::interface::create_compiler_and_run::<core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>, rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}>
  67:     0x7fbb1495e342 - <scoped_tls[12bdd19ea23b8236]::ScopedKey<rustc_span[2cde9445e4382002]::SessionGlobals>>::set::<rustc_interface[8e97ba9879e69f8a]::interface::run_compiler<core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>, rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}>::{closure#0}, core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>
  68:     0x7fbb1493059f - std[9817335c0e69941c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8e97ba9879e69f8a]::util::run_in_thread_pool_with_globals<rustc_interface[8e97ba9879e69f8a]::interface::run_compiler<core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>, rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}>::{closure#0}, core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>::{closure#0}, core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>
  69:     0x7fbb1494a8a9 - <<std[9817335c0e69941c]::thread::Builder>::spawn_unchecked_<rustc_interface[8e97ba9879e69f8a]::util::run_in_thread_pool_with_globals<rustc_interface[8e97ba9879e69f8a]::interface::run_compiler<core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>, rustc_driver[715d7736e30053d3]::run_compiler::{closure#1}>::{closure#0}, core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>::{closure#0}, core[9425a7bf32f2deb6]::result::Result<(), rustc_errors[1f6e64de7d5fbfd7]::ErrorGuaranteed>>::{closure#1} as core[9425a7bf32f2deb6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  70:     0x7fbb11eb08b3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9c58291f5c353dc0
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/alloc/src/boxed.rs:1935:9
  71:     0x7fbb11eb08b3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h65b2e7ca189d6f24
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/alloc/src/boxed.rs:1935:9
  72:     0x7fbb11eb08b3 - std::sys::unix::thread::Thread::new::thread_start::hf85f128f30ae11ee
                               at /rustc/db41351753df840773ca628d8daa040e95d00eef/library/std/src/sys/unix/thread.rs:108:17
  73:     0x7fbb11c8054d - <unknown>
  74:     0x7fbb11d05874 - clone
  75:                0x0 - <unknown>

note: 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.64.0-nightly (db4135175 2022-07-16) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [symbols_for_closure_captures] symbols for captures of closure `main::{closure#0}` in `main::{closure#0}`
#1 [mir_built] building MIR for `main::{closure#0}`
#2 [unsafety_check_result] unsafety-checking `main::{closure#0}`
#3 [unsafety_check_result] unsafety-checking `main`
#4 [mir_const] processing MIR for `main`
#5 [mir_promoted] processing `main`
#6 [mir_borrowck] borrow-checking `main`
#7 [type_of] computing type of `main::T::{opaque#0}`
#8 [check_mod_item_types] checking item types in top-level module
#9 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jul 17, 2022
@compiler-errors compiler-errors self-assigned this Jul 17, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jul 17, 2022
@ouz-a
Copy link
Contributor

ouz-a commented Jul 17, 2022

This will be fixed by #99383

@compiler-errors
Copy link
Member

@ouz-a assigned you the task!

jmqd pushed a commit to jmqd/rust that referenced this issue Jul 18, 2022
Improves the compiler error backtrace information, as shown in rust-lang#99363,
by using `span_bug` instead of `bug`.

New output:

```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
  --> /tmp/test.rs:11:27
   |
11 |         let Foo((a, b)) = foo;
   |                           ^^^

thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```

(Remainder of output truncated.)
@ouz-a
Copy link
Contributor

ouz-a commented Jul 18, 2022

This will be fixed by #99383

I am sorry I tested this wrongly so it won't be fixed by it. 😿

@compiler-errors
Copy link
Member

No worries! @ouz-a, do you still want to investigate the issue? Otherwise you can just rustbot release-assignment.

@ouz-a
Copy link
Contributor

ouz-a commented Jul 18, 2022

Yeah, I would like to take a shot at it.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 18, 2022
Use span_bug for unexpected field projection type

Improves the compiler error backtrace information, as shown in rust-lang#99363,
by using `span_bug` instead of `bug`.

New output:

```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
  --> /tmp/test.rs:11:27
   |
11 |         let Foo((a, b)) = foo;
   |                           ^^^

thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```

(Remainder of output truncated.)
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jul 19, 2022
Use span_bug for unexpected field projection type

Improves the compiler error backtrace information, as shown in rust-lang#99363,
by using `span_bug` instead of `bug`.

New output:

```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
  --> /tmp/test.rs:11:27
   |
11 |         let Foo((a, b)) = foo;
   |                           ^^^

thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```

(Remainder of output truncated.)
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jul 19, 2022
Use span_bug for unexpected field projection type

Improves the compiler error backtrace information, as shown in rust-lang#99363,
by using `span_bug` instead of `bug`.

New output:

```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
  --> /tmp/test.rs:11:27
   |
11 |         let Foo((a, b)) = foo;
   |                           ^^^

thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```

(Remainder of output truncated.)
@ouz-a
Copy link
Contributor

ouz-a commented Jul 21, 2022

This now crashes even without --edition=2021

@matthiaskrgr
Copy link
Member Author

Yes, the fix was reverted in #99495 because of bad perf.

@ouz-a
Copy link
Contributor

ouz-a commented Jul 21, 2022

🥲

@JohnTitor
Copy link
Member

Fixed on the latest nightly, marking as E-needs-test (or, feel free to close if we have a sufficient regression test)
@rustbot labels: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 15, 2023
@matthiaskrgr
Copy link
Member Author

looks like type-alias-impl-trait/issue-96572-unconstrained.rs covers this already, closing

@matthiaskrgr matthiaskrgr removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants