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

Crash when running clippy on crate within a crate. #49480

Closed
jonathanbarnett opened this issue Mar 29, 2018 · 1 comment
Closed

Crash when running clippy on crate within a crate. #49480

jonathanbarnett opened this issue Mar 29, 2018 · 1 comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@jonathanbarnett
Copy link

I have a rust crate that contains a separate Rust library within it (dependent on the main crate). Running Clippy on the main crate returns the usual Clippy output, but running:

cargo +nightly clippy -p [sub-crate name] or cargo +nightly clippy --all

returns:

error: internal compiler error: librustc/infer/canonical.rs:707: failed to lift `QueryResult { var_values: CanonicalVarValues { var_values: [] }, region_constraints: QueryRegionConstraints { region_outlives: [(ReErased, '?0), (ReErased, '?1), ('?0, ReErased), ('?1, ReErased)], ty_outlives: [] }, certainty: Proven, value: NormalizationResult { normalized_ty: bool } }`, canonicalized from `QueryResult { var_values: CanonicalVarValues { var_values: [] }, region_constraints: QueryRegionConstraints { region_outlives: [(ReErased, '_#0r), (ReErased, '_#1r), ('_#0r, ReErased), ('_#1r, ReErased)], ty_outlives: [] }, certainty: Proven, value: NormalizationResult { normalized_ty: bool } }`

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:543:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
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.26.0-nightly (e5277c145 2018-03-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type cdylib --crate-type lib

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

Meta

rustc --version --verbose:

rustc 1.25.0 (84203ca 2018-03-25)
binary: rustc
commit-hash: 84203ca
commit-date: 2018-03-25
host: x86_64-unknown-linux-gnu
release: 1.25.0
LLVM version: 6.0

Backtrace:

note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: core::ops::function::Fn::call
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:403
   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: <std::thread::local::LocalKey<T>>::try_with
  11: <std::thread::local::LocalKey<T>>::with
  12: rustc::ty::context::tls::with
  13: rustc::ty::context::tls::with_opt
  14: rustc::session::opt_span_bug_fmt
  15: rustc::session::bug_fmt
  16: rustc::infer::canonical::Canonicalizer::canonicalize
  17: rustc_traits::util::make_query_response
  18: rustc::ty::context::tls::enter
  19: rustc::infer::InferCtxtBuilder::enter
  20: rustc_traits::normalize_projection_ty::normalize_projection_ty
  21: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_projection_ty<'tcx>>::compute_result
  22: rustc::dep_graph::graph::DepGraph::with_task_impl
  23: rustc_errors::Handler::track_diagnostics
  24: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  25: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_projection_ty<'tcx>>::force
  26: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_projection_ty<'tcx>>::try_get
  27: rustc::ty::maps::TyCtxtAt::normalize_projection_ty
  28: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  29: rustc::traits::query::normalize::<impl rustc::infer::at::At<'cx, 'gcx, 'tcx>>::normalize
  30: rustc::ty::context::tls::enter
  31: rustc_traits::normalize_erasing_regions::normalize_ty_after_erasing_regions
  32: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_ty_after_erasing_regions<'tcx>>::compute_result
  33: rustc::dep_graph::graph::DepGraph::with_task_impl
  34: rustc_errors::Handler::track_diagnostics
  35: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  36: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_ty_after_erasing_regions<'tcx>>::force
  37: rustc::ty::maps::<impl rustc::ty::maps::queries::normalize_ty_after_erasing_regions<'tcx>>::try_get
  38: rustc::ty::maps::TyCtxtAt::normalize_ty_after_erasing_regions
  39: <rustc::traits::query::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder<'cx, 'tcx> as rustc::ty::fold::TypeFolder<'tcx, 'tcx>>::fold_ty
  40: <rustc_data_structures::accumulate_vec::AccumulateVec<A> as core::iter::traits::FromIterator<<A as rustc_data_structures::array_vec::Array>::Element>>::from_iter
  41: rustc::ty::fold::TypeFoldable::fold_with
  42: rustc::traits::query::normalize_erasing_regions::<impl rustc::ty::context::TyCtxt<'cx, 'tcx, 'tcx>>::normalize_erasing_late_bound_regions
  43: rustc_trans::mir::block::<impl rustc_trans::mir::FunctionCx<'a, 'tcx>>::trans_terminator
  44: rustc_trans::mir::trans_mir
  45: rustc_trans::base::trans_instance
  46: rustc_trans::trans_item::MonoItemExt::define
  47: rustc_trans::base::compile_codegen_unit
  48: rustc::ty::maps::<impl rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::compute_result
  49: rustc::dep_graph::graph::DepGraph::with_task_impl
  50: rustc_errors::Handler::track_diagnostics
  51: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  52: rustc::ty::maps::<impl rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::force
  53: rustc::ty::maps::<impl rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::try_get
  54: rustc::ty::maps::TyCtxtAt::compile_codegen_unit
  55: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::compile_codegen_unit
  56: rustc_trans::base::trans_crate
  57: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
  58: rustc::util::common::time
  59: rustc_driver::driver::phase_4_translate_to_llvm
  60: rustc_driver::driver::compile_input::{{closure}}
  61: <std::thread::local::LocalKey<T>>::with
  62: <std::thread::local::LocalKey<T>>::with
  63: rustc::ty::context::TyCtxt::create_and_enter
  64: rustc_driver::driver::compile_input
  65: rustc_driver::run_compiler_impl
  66: syntax::with_globals
  67: rustc_driver::run_compiler
@kennytm kennytm added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. labels Mar 29, 2018
@leoyvens
Copy link
Contributor

This looks like a dupe of #49114 and should be tracked in clippy.

@oli-obk oli-obk closed this as completed May 10, 2018
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) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants