Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Created June 13, 2018 17:30
Show Gist options
  • Save MaikKlein/42766fdf5f20a82245c81a318d6c3dae to your computer and use it in GitHub Desktop.
Save MaikKlein/42766fdf5f20a82245c81a318d6c3dae to your computer and use it in GitHub Desktop.
if let Some(def_id) = ty.ty_to_def_id() {
println!("{:?}", ty);
let table = self.tcx.impl_trait_ref(def_id);
println!("{:?}", table);
}
@MaikKlein
Copy link
Author

stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::session::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::session::opt_span_bug_fmt
  13: rustc::session::bug_fmt
  14: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::get_impl_trait
  15: rustc_metadata::cstore_impl::provide_extern::impl_trait_ref
  16: rustc::ty::maps::<impl rustc::ty::maps::config::QueryConfig<'tcx> for rustc::ty::maps::queries::impl_trait_ref<'tcx>>::compute
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_context
  19: rustc::dep_graph::graph::DepGraph::with_task_impl
  20: rustc::dep_graph::graph::DepGraph::with_task
  21: rustc::ty::context::tls::set_tlv
  22: rustc::ty::context::tls::with_context_opt
  23: rustc::ty::context::tls::with_related_context
  24: <rustc::ty::maps::plumbing::JobOwner<'a, 'tcx, Q>>::start
  25: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  26: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  27: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  28: rustc::ty::maps::TyCtxtAt::impl_trait_ref
  29: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::impl_trait_ref
  30: rlsl::context::CodegenCx::to_ty
  31: rlsl::context::CodegenCx::to_ty
  32: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once
  33: <std::collections::hash::map::HashMap<K, V, S> as core::iter::traits::Extend<(K, V)>>::extend
  34: <std::collections::hash::map::HashMap<K, V, S> as core::iter::traits::FromIterator<(K, V)>>::from_iter
  35: <rlsl::Entry<'tcx, T>>::create
  36: rlsl::trans_spirv
  37: <rlsl::RlslCompilerCalls as rustc_driver::CompilerCalls<'a>>::build_controller::{{closure}}
  38: rustc::ty::context::tls::set_tlv
  39: rustc::ty::context::tls::with_context_opt
  40: rustc::ty::context::tls::with_context
  41: rustc::dep_graph::graph::DepGraph::with_ignore
  42: rustc_driver::driver::compile_input::{{closure}}
  43: rustc::ty::context::tls::set_tlv
  44: rustc::ty::context::tls::enter_context
  45: <std::thread::local::LocalKey<T>>::try_with
  46: <std::thread::local::LocalKey<T>>::try_with
  47: <std::thread::local::LocalKey<T>>::with
  48: rustc::ty::context::tls::enter_global
  49: rustc::ty::context::TyCtxt::create_and_enter
  50: rustc_driver::driver::phase_3_run_analysis_passes
  51: rustc_driver::driver::compile_input
  52: rustc_driver::run_compiler_with_pool
  53: rustc_driver::driver::spawn_thread_pool
  54: <scoped_tls::ScopedKey<T>>::set
  55: <scoped_tls::ScopedKey<T>>::set
  56: syntax::with_globals
  57: rustc_driver::run_compiler
  58: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  59: std::panicking::try::do_call
  60: __rust_maybe_catch_panic
  61: std::panicking::try
  62: std::panic::catch_unwind
  63: rustc_driver::run
  64: rlsl::main
  65: std::rt::lang_start::{{closure}}
  66: std::panicking::try::do_call
  67: __rust_maybe_catch_panic
  68: std::panicking::try
  69: std::panic::catch_unwind
  70: std::rt::lang_start_internal
  71: std::rt::lang_start
  72: __libc_start_main
  73: _start
query stack during panic:
#0 [impl_trait_ref] processing `rlsl_math::Input`
end of query stack
error: aborting due to previous error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment