Skip to content

ICE "Encountered a freshend type with id 0 but our counter is only at 0": eclectic 0.11.0 #56865

Closed
@matthiaskrgr

Description

@matthiaskrgr

Found via this crater experiment: https://crater.rust-lang.org/ex/pr-56550

cargo new crashtest
cd crashtest
echo "eclectic = \"0.11.0\"" >> Cargo.toml
RUST_BACKTRACE=Full cargo check
    Checking eclectic v0.11.0
error: internal compiler error: src/librustc/infer/freshen.rs:165: Encountered a freshend type with id 0 but our counter is only at 0

thread 'main' panicked at 'Box<Any>', src/librustc_errors/lib.rs:600:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:210
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:225
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:492
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::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::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: <rustc::infer::freshen::TypeFreshener<'a, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  15: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  16: rustc::ty::fold::TypeFoldable::fold_with
  17: rustc::traits::select::SelectionContext::select
  18: rustc::infer::InferCtxt::commit_if_ok
  19: rustc::traits::project::opt_normalize_projection_type
  20: rustc::traits::project::normalize_projection_type
  21: <rustc::traits::project::AssociatedTypeNormalizer<'a, 'b, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  22: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  23: rustc::ty::fold::TypeFoldable::fold_with
  24: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
  25: <rustc::traits::project::AssociatedTypeNormalizer<'a, 'b, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  26: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  27: rustc::ty::fold::TypeFoldable::fold_with
  28: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
  29: <rustc::traits::project::AssociatedTypeNormalizer<'a, 'b, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  30: rustc::ty::fold::TypeFoldable::fold_with
  31: rustc::ty::fold::TypeFoldable::fold_with
  32: rustc::traits::project::normalize
  33: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
  34: <core::iter::FlatMap<I, U, F> as core::iter::iterator::Iterator>::next
  35: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  36: rustc::ty::wf::WfPredicates::normalize
  37: rustc::ty::wf::obligations
  38: <rustc_data_structures::obligation_forest::ObligationForest<O>>::process_obligations
  39: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_where_possible
  40: rustc_typeck::check::FnCtxt::select_obligations_where_possible
  41: rustc::ty::context::tls::with_related_context
  42: rustc::infer::InferCtxtBuilder::enter
  43: rustc_typeck::check::typeck_tables_of
  44: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::typeck_tables_of<'tcx>>::compute
  45: rustc::dep_graph::graph::DepGraph::with_task_impl
  46: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  47: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  48: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  49: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
  50: rustc::session::Session::track_errors
  51: rustc_typeck::check::typeck_item_bodies
  52: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::typeck_item_bodies<'tcx>>::compute
  53: rustc::dep_graph::graph::DepGraph::with_task_impl
  54: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  55: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  56: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  57: rustc::util::common::time
  58: rustc_typeck::check_crate
  59: rustc::ty::context::tls::enter_context
  60: <std::thread::local::LocalKey<T>>::with
  61: rustc::ty::context::TyCtxt::create_and_enter
  62: rustc_driver::driver::compile_input
  63: rustc_driver::run_compiler_with_pool
  64: <scoped_tls::ScopedKey<T>>::set
  65: rustc_driver::run_compiler
  66: rustc_driver::monitor::{{closure}}
  67: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:102
  68: rustc_driver::run
  69: rustc_driver::main
  70: std::rt::lang_start::{{closure}}
  71: std::panicking::try::do_call
             at src/libstd/rt.rs:59
             at src/libstd/panicking.rs:307
  72: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:102
  73: std::rt::lang_start_internal
             at src/libstd/panicking.rs:286
             at src/libstd/panic.rs:398
             at src/libstd/rt.rs:58
  74: main
  75: __libc_start_main
  76: <unknown>
query stack during panic:
#0 [typeck_tables_of] processing `assert_object_safe`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack
error: aborting due to previous error


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.33.0-nightly (96d1334e5 2018-12-14) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C target-cpu=native --crate-type lib

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

error: Could not compile `eclectic`.

To learn more, run the command again with --verbose.
rustc 1.33.0-nightly (96d1334e5 2018-12-14)
binary: rustc
commit-hash: 96d1334e567237b1507cd277938e7ae2de75ff51
commit-date: 2018-12-14
host: x86_64-unknown-linux-gnu
release: 1.33.0-nightly
LLVM version: 8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions