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: non_lifetime_binders unexpected bound ty in binder: BoundTy {...} #108181

Closed
matthiaskrgr opened this issue Feb 17, 2023 · 0 comments · Fixed by #108186
Closed

ICE: non_lifetime_binders unexpected bound ty in binder: BoundTy {...} #108181

matthiaskrgr opened this issue Feb 17, 2023 · 0 comments · Fixed by #108186
Assignees
Labels
C-bug Category: This is a bug. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` 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

matthiaskrgr commented Feb 17, 2023

Code

#![feature(non_lifetime_binders)]

fn main()  {
    for<main> || -> & main  {};
}

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (f4f5fc3e5 2023-02-17)
binary: rustc
commit-hash: f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3
commit-date: 2023-02-17
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

error[E0637]: `&` without an explicit lifetime name cannot be used here
 --> 2f364877ae32a51855925609c897ffa9f739c835.rs:2:21
  |
2 |     for<main> || -> & main  {};
  |                     ^ explicit lifetime name needed here

error[E0658]: `for<...>` binders for closures are experimental
 --> 2f364877ae32a51855925609c897ffa9f739c835.rs:2:5
  |
2 |     for<main> || -> & main  {};
  |     ^^^^^^^^^
  |
  = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
  = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
  = help: consider removing `for<...>`

warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <crate attribute>:1:9
  |
1 | feature(non_lifetime_binders)
  |         ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: type parameter `main` should have an upper camel case name
 --> 2f364877ae32a51855925609c897ffa9f739c835.rs:2:9
  |
2 |     for<main> || -> & main  {};
  |         ^^^^ help: convert the identifier to upper camel case: `Main`
  |
  = note: `#[warn(non_camel_case_types)]` on by default
Backtrace


error: internal compiler error: /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/compiler/rustc_middle/src/ty/fold.rs:306:33: unexpected bound ty in binder: BoundTy { var: 0, kind: Param(DefId(0:5 ~ 2f364877ae32a51855925609c897ffa9f739c835[5b1e]::main::{closure#0}::main), "main") }

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/compiler/rustc_errors/src/lib.rs:1642:9
stack backtrace:
   0:     0x7fe41bb6aa5a - std::backtrace_rs::backtrace::libunwind::trace::hebe09041f884c65d
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fe41bb6aa5a - std::backtrace_rs::backtrace::trace_unsynchronized::h546f6c63cbbce5a9
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fe41bb6aa5a - std::sys_common::backtrace::_print_fmt::h2559cb0cfed7a617
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fe41bb6aa5a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1fb4eaaaafa2d72a
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fe41bbca9ae - core::fmt::write::hbaef4432b3c9d07b
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/core/src/fmt/mod.rs:1232:17
   5:     0x7fe41bb5ae05 - std::io::Write::write_fmt::h1f8dce362441faaa
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/io/mod.rs:1684:15
   6:     0x7fe41bb6a825 - std::sys_common::backtrace::_print::hc0e92ab849a4f4e1
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fe41bb6a825 - std::sys_common::backtrace::print::h878cd11684ebdec3
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fe41bb6d59f - std::panicking::default_hook::{{closure}}::h2ea8a6875aa6312d
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/panicking.rs:267:22
   9:     0x7fe41bb6d2db - std::panicking::default_hook::h9e42277a84072188
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/panicking.rs:286:9
  10:     0x7fe41ee6e7b4 - <rustc_driver_impl[afa3c304d692170b]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[ebab21900c9c0a2]::ops::function::FnOnce<(&core[ebab21900c9c0a2]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fe41bb6dddd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2c34f129ed413128
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/alloc/src/boxed.rs:2002:9
  12:     0x7fe41bb6dddd - std::panicking::rust_panic_with_hook::h4c799b8c4fc0a70b
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/panicking.rs:692:13
  13:     0x7fe41f4274a1 - std[dc63ca99f82ce43d]::panicking::begin_panic::<rustc_errors[faa449d960b5ce55]::ExplicitBug>::{closure#0}
  14:     0x7fe41f41f116 - std[dc63ca99f82ce43d]::sys_common::backtrace::__rust_end_short_backtrace::<std[dc63ca99f82ce43d]::panicking::begin_panic<rustc_errors[faa449d960b5ce55]::ExplicitBug>::{closure#0}, !>
  15:     0x7fe41f379fe6 - std[dc63ca99f82ce43d]::panicking::begin_panic::<rustc_errors[faa449d960b5ce55]::ExplicitBug>
  16:     0x7fe41f41ed96 - std[dc63ca99f82ce43d]::panic::panic_any::<rustc_errors[faa449d960b5ce55]::ExplicitBug>
  17:     0x7fe41f41d906 - <rustc_errors[faa449d960b5ce55]::HandlerInner>::bug::<&alloc[d840872249f3dc84]::string::String>
  18:     0x7fe41f41d5d0 - <rustc_errors[faa449d960b5ce55]::Handler>::bug::<&alloc[d840872249f3dc84]::string::String>
  19:     0x7fe41f484b1b - rustc_middle[6caff671bb338453]::util::bug::opt_span_bug_fmt::<rustc_span[1010a352e5466fad]::span_encoding::Span>::{closure#0}
  20:     0x7fe41f4842da - rustc_middle[6caff671bb338453]::ty::context::tls::with_opt::<rustc_middle[6caff671bb338453]::util::bug::opt_span_bug_fmt<rustc_span[1010a352e5466fad]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fe41f4842a6 - rustc_middle[6caff671bb338453]::ty::context::tls::with_context_opt::<rustc_middle[6caff671bb338453]::ty::context::tls::with_opt<rustc_middle[6caff671bb338453]::util::bug::opt_span_bug_fmt<rustc_span[1010a352e5466fad]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fe41f484a66 - rustc_middle[6caff671bb338453]::util::bug::opt_span_bug_fmt::<rustc_span[1010a352e5466fad]::span_encoding::Span>
  23:     0x7fe41d141083 - rustc_middle[6caff671bb338453]::util::bug::bug_fmt
  24:     0x7fe41f0d445c - <rustc_middle[6caff671bb338453]::ty::context::TyCtxt>::replace_late_bound_regions_uncached::<rustc_middle[6caff671bb338453]::ty::sty::FnSig, <rustc_middle[6caff671bb338453]::ty::context::TyCtxt>::replace_late_bound_regions<rustc_middle[6caff671bb338453]::ty::sty::FnSig, <rustc_middle[6caff671bb338453]::ty::context::TyCtxt>::erase_late_bound_regions<rustc_middle[6caff671bb338453]::ty::sty::FnSig>::{closure#0}>::{closure#0}>::{closure#0}
  25:     0x7fe41d292e90 - <rustc_middle[6caff671bb338453]::ty::fold::BoundVarReplacer<rustc_middle[6caff671bb338453]::ty::fold::FnMutDelegate> as rustc_type_ir[b1287c9e7106c79]::fold::FallibleTypeFolder<rustc_middle[6caff671bb338453]::ty::context::TyCtxt>>::try_fold_ty
  26:     0x7fe41d51c1a7 - <rustc_middle[6caff671bb338453]::ty::Ty as rustc_type_ir[b1287c9e7106c79]::fold::TypeSuperFoldable<rustc_middle[6caff671bb338453]::ty::context::TyCtxt>>::super_fold_with::<rustc_middle[6caff671bb338453]::ty::fold::BoundVarReplacer<rustc_middle[6caff671bb338453]::ty::fold::FnMutDelegate>>
  27:     0x7fe41d51b865 - <&rustc_middle[6caff671bb338453]::ty::list::List<rustc_middle[6caff671bb338453]::ty::Ty> as rustc_type_ir[b1287c9e7106c79]::fold::TypeFoldable<rustc_middle[6caff671bb338453]::ty::context::TyCtxt>>::try_fold_with::<rustc_middle[6caff671bb338453]::ty::fold::BoundVarReplacer<rustc_middle[6caff671bb338453]::ty::fold::FnMutDelegate>>
  28:     0x7fe41d28319b - <rustc_hir_typeck[59924f8822ff3497]::fn_ctxt::FnCtxt>::closure_sigs
  29:     0x7fe41d2811c2 - <rustc_hir_typeck[59924f8822ff3497]::fn_ctxt::FnCtxt>::check_expr_closure
  30:     0x7fe41d1fedce - <rustc_hir_typeck[59924f8822ff3497]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x7fe41d224e45 - <rustc_hir_typeck[59924f8822ff3497]::fn_ctxt::FnCtxt>::check_block_with_expected
  32:     0x7fe41d1fb52e - <rustc_hir_typeck[59924f8822ff3497]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7fe41d5b689b - <rustc_hir_typeck[59924f8822ff3497]::fn_ctxt::FnCtxt>::check_return_expr
  34:     0x7fe41d5aeb12 - rustc_hir_typeck[59924f8822ff3497]::check::check_fn
  35:     0x7fe41d598ef2 - <rustc_hir_typeck[59924f8822ff3497]::inherited::InheritedBuilder>::enter::<rustc_hir_typeck[59924f8822ff3497]::typeck_with_fallback<rustc_hir_typeck[59924f8822ff3497]::typeck::{closure#0}>::{closure#0}::{closure#1}, &rustc_middle[6caff671bb338453]::ty::typeck_results::TypeckResults>
  36:     0x7fe41d58da16 - rustc_hir_typeck[59924f8822ff3497]::typeck
  37:     0x7fe41d58c113 - rustc_query_system[5ff89444bbfc32f5]::query::plumbing::try_execute_query::<rustc_query_impl[ef929ccf3c28623b]::queries::typeck, rustc_query_impl[ef929ccf3c28623b]::plumbing::QueryCtxt>
  38:     0x7fe41e5f0f8b - rustc_data_structures[cd995ba5556f5758]::sync::par_for_each_in::<&[rustc_span[1010a352e5466fad]::def_id::LocalDefId], <rustc_middle[6caff671bb338453]::hir::map::Map>::par_body_owners<rustc_hir_typeck[59924f8822ff3497]::typeck_item_bodies::{closure#0}>::{closure#0}>
  39:     0x7fe41e5f0dcf - rustc_hir_typeck[59924f8822ff3497]::typeck_item_bodies
  40:     0x7fe41e46fca3 - rustc_query_system[5ff89444bbfc32f5]::query::plumbing::try_execute_query::<rustc_query_impl[ef929ccf3c28623b]::queries::typeck_item_bodies, rustc_query_impl[ef929ccf3c28623b]::plumbing::QueryCtxt>
  41:     0x7fe41e86e59b - <rustc_query_impl[ef929ccf3c28623b]::Queries as rustc_middle[6caff671bb338453]::ty::query::QueryEngine>::typeck_item_bodies
  42:     0x7fe41d3136a3 - <rustc_session[66793dd6b8780a4a]::session::Session>::time::<(), rustc_hir_analysis[257f64c795d1d076]::check_crate::{closure#7}>
  43:     0x7fe41d3106a2 - rustc_hir_analysis[257f64c795d1d076]::check_crate
  44:     0x7fe41d306062 - rustc_interface[686dab9608bc6033]::passes::analysis
  45:     0x7fe41e663d92 - rustc_query_system[5ff89444bbfc32f5]::query::plumbing::try_execute_query::<rustc_query_impl[ef929ccf3c28623b]::queries::analysis, rustc_query_impl[ef929ccf3c28623b]::plumbing::QueryCtxt>
  46:     0x7fe41e867e2a - <rustc_query_impl[ef929ccf3c28623b]::Queries as rustc_middle[6caff671bb338453]::ty::query::QueryEngine>::analysis
  47:     0x7fe41e080303 - <rustc_interface[686dab9608bc6033]::queries::QueryResult<&rustc_middle[6caff671bb338453]::ty::context::GlobalCtxt>>::enter::<core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>, rustc_driver_impl[afa3c304d692170b]::run_compiler::{closure#1}::{closure#2}::{closure#3}>
  48:     0x7fe41e07f4d4 - <rustc_interface[686dab9608bc6033]::interface::Compiler>::enter::<rustc_driver_impl[afa3c304d692170b]::run_compiler::{closure#1}::{closure#2}, core[ebab21900c9c0a2]::result::Result<core[ebab21900c9c0a2]::option::Option<rustc_interface[686dab9608bc6033]::queries::Linker>, rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>>
  49:     0x7fe41e07a6f4 - rustc_span[1010a352e5466fad]::with_source_map::<core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>, rustc_interface[686dab9608bc6033]::interface::run_compiler<core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>, rustc_driver_impl[afa3c304d692170b]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  50:     0x7fe41e07a204 - <scoped_tls[d487b98c36b0d138]::ScopedKey<rustc_span[1010a352e5466fad]::SessionGlobals>>::set::<rustc_interface[686dab9608bc6033]::interface::run_compiler<core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>, rustc_driver_impl[afa3c304d692170b]::run_compiler::{closure#1}>::{closure#0}, core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>>
  51:     0x7fe41e079902 - std[dc63ca99f82ce43d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[686dab9608bc6033]::util::run_in_thread_pool_with_globals<rustc_interface[686dab9608bc6033]::interface::run_compiler<core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>, rustc_driver_impl[afa3c304d692170b]::run_compiler::{closure#1}>::{closure#0}, core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>>
  52:     0x7fe41e0796ac - <<std[dc63ca99f82ce43d]::thread::Builder>::spawn_unchecked_<rustc_interface[686dab9608bc6033]::util::run_in_thread_pool_with_globals<rustc_interface[686dab9608bc6033]::interface::run_compiler<core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>, rustc_driver_impl[afa3c304d692170b]::run_compiler::{closure#1}>::{closure#0}, core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ebab21900c9c0a2]::result::Result<(), rustc_errors[faa449d960b5ce55]::ErrorGuaranteed>>::{closure#1} as core[ebab21900c9c0a2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  53:     0x7fe41bb77c63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9fd36c4a0ba5b15d
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/alloc/src/boxed.rs:1988:9
  54:     0x7fe41bb77c63 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd37d267854c7434f
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/alloc/src/boxed.rs:1988:9
  55:     0x7fe41bb77c63 - std::sys::unix::thread::Thread::new::thread_start::h1ff24d5a09f2a8be
                               at /rustc/f4f5fc3e5cc70b7a43bf7b518c455f3d9bada9e3/library/std/src/sys/unix/thread.rs:108:17
  56:     0x7fe41b907bb5 - <unknown>
  57:     0x7fe41b989d90 - <unknown>
  58:                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: rustc 1.69.0-nightly (f4f5fc3e5 2023-02-17) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=feature(non_lifetime_binders)

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors; 2 warnings emitted

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

@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 Feb 17, 2023
@estebank estebank added the F-non_lifetime_binders `#![feature(non_lifetime_binders)]` label Feb 18, 2023
@bors bors closed this as completed in d3d5163 Feb 18, 2023
@compiler-errors compiler-errors self-assigned this Mar 16, 2023
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. F-non_lifetime_binders `#![feature(non_lifetime_binders)]` 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

Successfully merging a pull request may close this issue.

3 participants