Skip to content

Impossible case reached #2831

Closed
Closed
@mrcnski

Description

@mrcnski

Hi there,

We're seeing the following error when running clippy. I pasted the relevant excerpt below, and the full Travis job is here. The usual workaround of running cargo check first seems to work for now.

Let me know what additional information would be useful in debugging this. Running clippy 0.0.206 on this repo should be enough to reproduce the issue locally.

error: internal compiler error: librustc/ty/relate.rs:700: impossible case reached
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:554:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:467
   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::ty::relate::TypeRelation::relate
  15: <&'a mut I as core::iter::iterator::Iterator>::next
  16: <core::result::Result<T, E> as rustc::ty::context::InternIteratorElement<T, R>>::intern_with
  17: <rustc::ty::sty::TraitRef<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
  18: rustc::infer::InferCtxt::commit_if_ok
  19: rustc::traits::select::SelectionContext::match_impl
  20: rustc::infer::InferCtxt::probe
  21: rustc::ty::trait_def::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::for_each_relevant_impl
  22: rustc::traits::select::SelectionContext::assemble_candidates
  23: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache
  24: rustc::dep_graph::graph::DepGraph::with_anon_task
  25: rustc::traits::select::SelectionContext::candidate_from_obligation
  26: rustc::traits::select::SelectionContext::evaluate_stack
  27: rustc::dep_graph::graph::DepGraph::with_anon_task
  28: rustc::traits::select::SelectionContext::evaluate_predicate_recursively
  29: rustc::traits::select::SelectionContext::evaluate_obligation_recursively
  30: rustc::ty::context::tls::with_related_context
  31: rustc::infer::InferCtxtBuilder::enter
  32: rustc_traits::evaluate_obligation::evaluate_obligation
  33: rustc::ty::maps::__query_compute::evaluate_obligation
  34: rustc::ty::maps::<impl rustc::ty::maps::config::QueryConfig<'tcx> for rustc::ty::maps::queries::evaluate_obligation<'tcx>>::compute
  35: rustc::dep_graph::graph::DepGraph::with_task_impl
  36: rustc::ty::context::tls::with_related_context
  37: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  38: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  39: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::evaluate_obligation
  40: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::predicate_must_hold
  41: rustc::ty::context::GlobalCtxt::enter_local
  42: clippy_lints::utils::implements_trait
  43: core::iter::iterator::Iterator::try_for_each::{{closure}}
  44: <clippy_lints::needless_pass_by_value::NeedlessPassByValue as rustc::lint::LateLintPass<'a, 'tcx>>::check_fn
  45: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  46: rustc::hir::intravisit::walk_impl_item
  47: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_impl_item
  48: rustc::hir::intravisit::walk_impl_item_ref
  49: rustc::hir::intravisit::walk_item
  50: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  51: rustc::hir::intravisit::walk_mod
  52: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  53: rustc::hir::intravisit::walk_item
  54: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  55: rustc::hir::intravisit::walk_mod
  56: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  57: rustc::hir::intravisit::walk_item
  58: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  59: rustc::hir::intravisit::walk_mod
  60: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  61: rustc::lint::context::check_crate
  62: rustc::util::common::time
  63: rustc::ty::context::tls::enter_context
  64: <std::thread::local::LocalKey<T>>::with
  65: rustc::ty::context::TyCtxt::create_and_enter
  66: rustc_driver::driver::compile_input
  67: rustc_driver::run_compiler_with_pool
  68: syntax::with_globals
  69: rustc_driver::run_compiler
  70: std::panicking::try::do_call
  71: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  72: rustc_driver::run
  73: clippy_driver::main
  74: std::rt::lang_start::{{closure}}
  75: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  76: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  77: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:374
             at libstd/rt.rs:58
  78: main
  79: __libc_start_main
  80: <unknown>
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `&T: wrapper::descriptors::desc::Desc<wrapper::objects::jclass::JClass<'_>>`
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.28.0-nightly (5bf68db6e 2018-05-28) running on x86_64-unknown-linux-gnu
note: compiler flags: -C opt-level=3 -C opt-level=2 -C codegen-units=8 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `jni`.
Caused by:
  process didn't exit successfully: `/home/travis/.cargo/bin/clippy-driver rustc --crate-name jni /home/travis/.cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/jni-0.10.1/src/lib.rs --crate-type lib --emit=dep-info,metadata -C opt-level=3 --cfg feature="backtrace" --cfg feature="default" --cfg feature="error-chain" -C metadata=443a1eeac29cab09 -C extra-filename=-443a1eeac29cab09 --out-dir /home/travis/build/maidsafe/safe_client_libs/target/release/deps -L dependency=/home/travis/build/maidsafe/safe_client_libs/target/release/deps --extern cesu8=/home/travis/build/maidsafe/safe_client_libs/target/release/deps/libcesu8-990ed369d5ed2c20.rmeta --extern combine=/home/travis/build/maidsafe/safe_client_libs/target/release/deps/libcombine-a36df1c2285c6c57.rmeta --extern error_chain=/home/travis/build/maidsafe/safe_client_libs/target/release/deps/liberror_chain-c1d1b45c6be1ead8.rmeta --extern jni_sys=/home/travis/build/maidsafe/safe_client_libs/target/release/deps/libjni_sys-62be6b1159a364d5.rmeta --extern log=/home/travis/build/maidsafe/safe_client_libs/target/release/deps/liblog-0b6386fffb4fba18.rmeta --cap-lints allow -C opt-level=2 -C codegen-units=8 -L native=/home/travis/build/maidsafe/safe_client_libs/target/release/build/backtrace-sys-c7e1721ee38cd86b/out/.libs` (exit code: 101)

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions