Skip to content

debug-assertion ICE: assertion failed: !value.has_escaping_bound_vars() #74713

@DutchGhost

Description

@DutchGhost
Contributor

Code

fn bug<'a>()
where
    [(); {
        let _: &'a ();
    }]:
{}

Meta

rustc --version --verbose:

rustc 1.45.0 (5c1f21c3b 2020-07-13)

Error output

thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /checkout/compiler/rustc_middle/src/ty/sty.rs:969:9

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.
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.53.0-nightly (43012395e 2021-04-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [typeck] type-checking `bug::{constant#0}`
#1 [eval_to_allocation_raw] const-evaluating + checking `bug::{constant#0}`

New backtrace: https://gist.github.com/JohnTitor/8b492f5d69b0b704d618c11da81c05ff

Backtrace

thread 'rustc' panicked at 'Box<Any>', /rustc/5c1f21c3b82297671ad3ae1e8c942d2ca92e84f2/src/libstd/macros.rs:13:23
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:490
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::span_bug
  14: rustc_errors::Handler::span_bug
  15: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc_middle::ty::context::tls::with_opt::{{closure}}
  17: rustc_middle::ty::context::tls::with_opt
  18: rustc_middle::util::bug::opt_span_bug_fmt
  19: rustc_middle::util::bug::span_bug_fmt
  20: rustc_typeck::check::Inherited::register_predicate
  21: <rustc_typeck::check::GatherLocalsVisitor as rustc_hir::intravisit::Visitor>::visit_local
  22: rustc_hir::intravisit::walk_expr
  23: rustc_middle::ty::context::GlobalCtxt::enter_local
  24: rustc_typeck::check::typeck_tables_of
  25: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck_tables_of>::compute
  26: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  27: rustc_data_structures::stack::ensure_sufficient_stack
  28: rustc_query_system::query::plumbing::get_query_impl
  29: rustc_mir::const_eval::eval_queries::const_eval_raw_provider
  30: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::const_eval_raw>::compute
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  32: rustc_data_structures::stack::ensure_sufficient_stack
  33: rustc_query_system::query::plumbing::get_query_impl
  34: rustc_mir::const_eval::eval_queries::const_eval_validated_provider
  35: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::const_eval_validated>::compute
  36: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  37: rustc_data_structures::stack::ensure_sufficient_stack
  38: rustc_query_system::query::plumbing::get_query_impl
  39: rustc_mir::const_eval::eval_queries::const_eval_validated_provider
  40: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::const_eval_validated>::compute
  41: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  42: rustc_data_structures::stack::ensure_sufficient_stack
  43: rustc_query_system::query::plumbing::get_query_impl
  44: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  45: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  46: <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_const
  47: rustc_middle::ty::structural_impls::<impl rustc_middle::ty::fold::TypeFoldable for &rustc_middle::ty::TyS>::super_fold_with
  48: <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty
  49: rustc_middle::ty::fold::TypeFoldable::fold_with
  50: rustc_middle::ty::fold::TypeFoldable::fold_with
  51: rustc_data_structures::stack::ensure_sufficient_stack
  52: rustc_trait_selection::traits::fully_normalize
  53: rustc_middle::ty::context::GlobalCtxt::enter_local
  54: rustc_trait_selection::traits::do_normalize_predicates
  55: rustc_trait_selection::traits::normalize_param_env_or_error
  56: rustc_ty::ty::param_env
  57: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::param_env>::compute
  58: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  59: rustc_query_system::query::plumbing::get_query_impl
  60: rustc_typeck::check::wfcheck::check_item_well_formed
  61: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_item_well_formed>::compute
  62: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  63: rustc_query_system::query::plumbing::get_query_impl
  64: rustc_query_system::query::plumbing::ensure_query_impl
  65: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  66: rustc_hir::hir::Crate::par_visit_all_item_likes
  67: rustc_typeck::check_crate
  68: rustc_interface::passes::analysis
  69: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  70: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  71: rustc_query_system::query::plumbing::get_query_impl
  72: rustc_middle::ty::context::tls::enter_global
  73: rustc_interface::interface::run_compiler_in_existing_thread_pool
  74: rustc_ast::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.0 (5c1f21c3b 2020-07-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck_tables_of] type-checking `bug::{{constant}}#0`
#1 [const_eval_raw] const-evaluating `bug::{{constant}}#0`
#2 [const_eval_validated] const-evaluating + checking `bug::{{constant}}#0`
#3 [const_eval_validated] const-evaluating + checking `bug::{{constant}}#0`
#4 [param_env] computing normalized predicates of `bug`
#5 [check_item_well_formed] checking that `bug` is well-formed
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `playground`.

This probably is the same as found in #70292, except this hits on stable :)

Activity

added
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.
on Jul 24, 2020
added
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Jul 24, 2020
DutchGhost

DutchGhost commented on Jul 24, 2020

@DutchGhost
ContributorAuthor

https://godbolt.org/z/8ns3Kq
1.17 - now ICE's
1.9 - 1.16 just error normally
1.6 - 1.8 also produce an ICE (unreachable code in const_eval.rs)
1.0 - 1.5 just error normally

lcnr

lcnr commented on Jul 25, 2020

@lcnr
Contributor

This is has a similar cause to #56445.

spastorino

spastorino commented on Jul 29, 2020

@spastorino
Member

Assigning P-high as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

added
P-highHigh priority
and removed
I-prioritizeIssue: Indicates that prioritization has been requested for this issue.
on Jul 29, 2020
Alexendoo

Alexendoo commented on Dec 28, 2020

@Alexendoo
Member

Since min_const_generics stabilisation this now requires #![feature(const_generics)]

#![feature(const_generics)]

fn bug<'a>()
where
    [(); {
        let _: &'a ();
    }]: ,
{
}

fn main() {}
JohnTitor

JohnTitor commented on Jan 18, 2021

@JohnTitor
Member

Seems it has been fixed (finally) in the latest nightly, marking as E-needs-test

10 remaining items

added
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
on Jun 28, 2022
self-assigned this
on Jul 12, 2022
added a commit that references this issue on Jul 13, 2022
58bba51
added a commit that references this issue on Jul 13, 2022
75d03d6
added a commit that references this issue on Jul 13, 2022
febc316
added a commit that references this issue on Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-generic_const_exprs`#![feature(generic_const_exprs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityPG-const-genericsProject group: Const genericsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @spastorino@carado@Alexendoo@chengniansun@Dylan-DPC-zz

    Issue actions

      debug-assertion ICE: `assertion failed: !value.has_escaping_bound_vars()` · Issue #74713 · rust-lang/rust