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

[debug assertion] thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()' #72410

Closed
dwrensha opened this issue May 21, 2020 · 2 comments · Fixed by #72714
Labels
C-bug Category: This is a bug. 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

@dwrensha
Copy link
Contributor

Using a rustc built from commit 0aa6751 with debug assertions enabled (debug=true in config.toml), I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

pub trait Foo {
    fn map() where Self: Sized, for<'a> &'a mut [u8] : ;
}
$ RUST_BACKTRACE=1 build/x86_64-unknown-linux-gnu/stage1/bin/rustc ~/Desktop/main.rs
error[E0601]: `main` function not found in crate `main`
 --> /home/dwrensha/Desktop/main.rs:1:1
  |
1 | / pub trait Foo {
2 | |     fn map() where Self: Sized, for<'a> &'a mut [u8] : ;
3 | | }
  | |_^ consider adding a `main` function to `/home/dwrensha/Desktop/main.rs`

thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /home/dwrensha/src/rust/src/libstd/macros.rs:13:23
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /home/dwrensha/.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:1069
   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: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at ./src/liballoc/boxed.rs:1071
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1167
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:490
  13: std::panicking::begin_panic
             at ./src/libstd/panicking.rs:410
  14: rustc_middle::ty::sty::Binder<T>::dummy
             at ./src/libstd/macros.rs:13
  15: rustc_typeck::collect::explicit_predicates_of
             at src/librustc_typeck/collect.rs:1902
  16: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::explicit_predicates_of>::compute
             at ./src/librustc_middle/ty/query/plumbing.rs:362
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
  18: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:0
  19: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
  20: stacker::maybe_grow
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  21: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  22: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
  23: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1679
  24: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1663
  25: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1679
  26: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:71
  27: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1767
  28: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1751
  29: rustc_middle::ty::context::tls::with_context_opt
             at ./src/librustc_middle/ty/context.rs:1740
  30: rustc_middle::ty::context::tls::with_context
             at ./src/librustc_middle/ty/context.rs:1751
  31: rustc_middle::ty::context::tls::with_related_context
             at ./src/librustc_middle/ty/context.rs:1764
  32: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./src/librustc_middle/ty/query/plumbing.rs:60
  33: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
  34: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
  35: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
  36: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
  37: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
  38: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./src/librustc_query_system/query/caches.rs:111
  39: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/query/plumbing.rs:369
  40: rustc_query_system::query::plumbing::get_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:631
  41: rustc_query_system::query::plumbing::get_query
             at ./src/librustc_query_system/query/plumbing.rs:731
  42: rustc_middle::ty::query::TyCtxtAt::explicit_predicates_of
             at ./src/librustc_middle/ty/query/plumbing.rs:472
  43: rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::explicit_predicates_of
             at ./src/librustc_middle/ty/query/plumbing.rs:433
  44: rustc_typeck::collect::predicates_defined_on
             at src/librustc_typeck/collect.rs:1616
  45: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::predicates_defined_on>::compute
             at ./src/librustc_middle/ty/query/plumbing.rs:362
  46: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
  47: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:0
  48: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
  49: stacker::maybe_grow
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  50: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  51: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
  52: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1679
  53: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1663
  54: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1679
  55: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:71
  56: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1767
  57: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1751
  58: rustc_middle::ty::context::tls::with_context_opt
             at ./src/librustc_middle/ty/context.rs:1740
  59: rustc_middle::ty::context::tls::with_context
             at ./src/librustc_middle/ty/context.rs:1751
  60: rustc_middle::ty::context::tls::with_related_context
             at ./src/librustc_middle/ty/context.rs:1764
  61: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./src/librustc_middle/ty/query/plumbing.rs:60
  62: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
  63: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
  64: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
  65: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
  66: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
  67: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./src/librustc_query_system/query/caches.rs:111
  68: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/query/plumbing.rs:369
  69: rustc_query_system::query::plumbing::get_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:631
  70: rustc_query_system::query::plumbing::get_query
             at ./src/librustc_query_system/query/plumbing.rs:731
  71: rustc_middle::ty::query::TyCtxtAt::predicates_defined_on
             at ./src/librustc_middle/ty/query/plumbing.rs:472
  72: rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::predicates_defined_on
             at ./src/librustc_middle/ty/query/plumbing.rs:433
  73: rustc_typeck::collect::predicates_of
             at src/librustc_typeck/collect.rs:1640
  74: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::predicates_of>::compute
             at ./src/librustc_middle/ty/query/plumbing.rs:362
  75: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
  76: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:0
  77: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
  78: stacker::maybe_grow
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  79: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  80: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
  81: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1679
  82: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1663
  83: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1679
  84: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:71
  85: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1767
  86: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1751
  87: rustc_middle::ty::context::tls::with_context_opt
             at ./src/librustc_middle/ty/context.rs:1740
  88: rustc_middle::ty::context::tls::with_context
             at ./src/librustc_middle/ty/context.rs:1751
  89: rustc_middle::ty::context::tls::with_related_context
             at ./src/librustc_middle/ty/context.rs:1764
  90: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./src/librustc_middle/ty/query/plumbing.rs:60
  91: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
  92: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
  93: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
  94: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
  95: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
  96: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./src/librustc_query_system/query/caches.rs:111
  97: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/query/plumbing.rs:369
  98: rustc_query_system::query::plumbing::get_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:631
  99: rustc_query_system::query::plumbing::ensure_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:0
 100: rustc_query_system::query::plumbing::ensure_query
             at ./src/librustc_query_system/query/plumbing.rs:741
 101: rustc_middle::ty::query::TyCtxtEnsure::predicates_of
             at ./src/librustc_middle/ty/query/plumbing.rs:389
 102: rustc_typeck::collect::convert_trait_item
             at src/librustc_typeck/collect.rs:730
 103: <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_trait_item
             at src/librustc_typeck/collect.rs:232
 104: <rustc_hir::intravisit::DeepVisitor<V> as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_trait_item
             at ./src/librustc_hir/intravisit.rs:61
 105: rustc_middle::hir::map::Map::visit_item_likes_in_module
             at ./src/librustc_middle/hir/map/mod.rs:495
 106: rustc_typeck::collect::collect_mod_item_types
             at src/librustc_typeck/collect.rs:58
 107: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::collect_mod_item_types>::compute
             at ./src/librustc_middle/ty/query/plumbing.rs:362
 108: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
 109: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:0
 110: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
 111: stacker::maybe_grow
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
 112: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
 113: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
 114: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1679
 115: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1663
 116: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1679
 117: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:71
 118: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1767
 119: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1751
 120: rustc_middle::ty::context::tls::with_context_opt
             at ./src/librustc_middle/ty/context.rs:1740
 121: rustc_middle::ty::context::tls::with_context
             at ./src/librustc_middle/ty/context.rs:1751
 122: rustc_middle::ty::context::tls::with_related_context
             at ./src/librustc_middle/ty/context.rs:1764
 123: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./src/librustc_middle/ty/query/plumbing.rs:60
 124: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
 125: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
 126: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
 127: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
 128: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
 129: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./src/librustc_query_system/query/caches.rs:111
 130: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/query/plumbing.rs:369
 131: rustc_query_system::query::plumbing::get_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:631
 132: rustc_query_system::query::plumbing::ensure_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:679
 133: rustc_query_system::query::plumbing::ensure_query
             at ./src/librustc_query_system/query/plumbing.rs:741
 134: rustc_middle::ty::query::TyCtxtEnsure::collect_mod_item_types
             at ./src/librustc_middle/ty/query/plumbing.rs:389
 135: rustc_typeck::check_crate::{{closure}}::{{closure}}
             at src/librustc_typeck/lib.rs:330
 136: rustc_data_structures::profiling::VerboseTimingGuard::run
             at ./src/librustc_data_structures/profiling.rs:573
 137: rustc_session::utils::<impl rustc_session::session::Session>::time
             at ./src/librustc_session/utils.rs:9
 138: rustc_typeck::check_crate::{{closure}}
             at src/librustc_typeck/lib.rs:328
 139: rustc_session::session::Session::track_errors
             at ./src/librustc_session/session.rs:353
 140: rustc_typeck::check_crate
             at src/librustc_typeck/lib.rs:327
 141: rustc_interface::passes::analysis
             at src/librustc_interface/passes.rs:807
 142: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
             at ./src/librustc_middle/ty/query/plumbing.rs:362
 143: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
 144: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:0
 145: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
 146: stacker::maybe_grow
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
 147: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
 148: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
 149: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1679
 150: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1663
 151: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1679
 152: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:71
 153: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1767
 154: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1751
 155: rustc_middle::ty::context::tls::with_context_opt
             at ./src/librustc_middle/ty/context.rs:1740
 156: rustc_middle::ty::context::tls::with_context
             at ./src/librustc_middle/ty/context.rs:1751
 157: rustc_middle::ty::context::tls::with_related_context
             at ./src/librustc_middle/ty/context.rs:1764
 158: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./src/librustc_middle/ty/query/plumbing.rs:60
 159: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
 160: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
 161: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
 162: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
 163: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
 164: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./src/librustc_query_system/query/caches.rs:111
 165: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/query/plumbing.rs:369
 166: rustc_query_system::query::plumbing::get_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:631
 167: rustc_query_system::query::plumbing::get_query
             at ./src/librustc_query_system/query/plumbing.rs:731
 168: rustc_middle::ty::query::TyCtxtAt::analysis
             at ./src/librustc_middle/ty/query/plumbing.rs:472
 169: rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::analysis
             at ./src/librustc_middle/ty/query/plumbing.rs:433
 170: rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}
             at src/librustc_driver/lib.rs:383
 171: rustc_middle::ty::context::tls::enter_global::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1702
 172: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1679
 173: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1663
 174: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1679
 175: rustc_middle::ty::context::tls::enter_global
             at ./src/librustc_middle/ty/context.rs:1702
 176: rustc_interface::passes::QueryContext::enter
             at ./src/librustc_interface/passes.rs:708
 177: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at src/librustc_driver/lib.rs:383
 178: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at ./src/librustc_interface/queries.rs:385
 179: rustc_driver::run_compiler::{{closure}}
             at src/librustc_driver/lib.rs:283
 180: rustc_interface::interface::run_compiler_in_existing_thread_pool
             at ./src/librustc_interface/interface.rs:199
 181: rustc_interface::interface::run_compiler::{{closure}}
             at ./src/librustc_interface/interface.rs:213
 182: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:149
 183: scoped_tls::ScopedKey<T>::set
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
 184: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:145
 185: scoped_tls::ScopedKey<T>::set
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
 186: rustc_ast::attr::with_globals::{{closure}}
             at ./src/librustc_ast/attr/mod.rs:44
 187: scoped_tls::ScopedKey<T>::set
             at /home/dwrensha/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
 188: rustc_ast::attr::with_globals
             at ./src/librustc_ast/attr/mod.rs:44
 189: rustc_interface::util::spawn_thread_pool::{{closure}}
             at ./src/librustc_interface/util.rs:144
 190: rustc_interface::util::scoped_thread::{{closure}}
             at ./src/librustc_interface/util.rs:119
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [explicit_predicates_of] processing `Foo::map`
#1 [predicates_defined_on] processing `Foo::map`
#2 [predicates_of] processing `Foo::map`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.
@dwrensha
Copy link
Contributor Author

This looks similar to #70813. cc @matthewjasper

Note that the span for the assertion seems to be wrong:

 14: rustc_middle::ty::sty::Binder<T>::dummy
             at ./src/libstd/macros.rs:13

I would expect the source location to be src/librustc_middle/ty/sty.rs:856:9.

@dwrensha
Copy link
Contributor Author

If I add an empty main(), then my rustup-installed rustc compiles the program without error:

pub trait Foo {
    fn map() where Self: Sized, for<'a> &'a mut [u8] :;
}
fn main() {}

but my debug build still ICEs.

@Elinvynia Elinvynia added C-bug Category: This is a bug. 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. labels May 21, 2020
@bors bors closed this as completed in 105cd49 Jul 21, 2020
rust-timer added a commit to rust-timer/rust that referenced this issue Jul 21, 2020
Original message:
Rollup merge of rust-lang#72714 - JohnTitor:debug-assert, r=nikomatsakis

Fix debug assertion in typeck

Fixes rust-lang#72410
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. 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.

2 participants