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

Unable to run clippy with this project as a dependency #2

Closed
nirvdrum opened this issue May 24, 2019 · 3 comments
Closed

Unable to run clippy with this project as a dependency #2

nirvdrum opened this issue May 24, 2019 · 3 comments

Comments

@nirvdrum
Copy link

Apologies in advance if I'm filing this issue against the wrong project. Earlier today I tried upgrading im-rc from 12.3.0 to 13.0.0, which brought sized-chunks in as a new transitive dependency. Since it was added to the project, clippy fails to run now and appears to point at sized-chunks as the culprit.

$ rustc --version
rustc 1.35.0 (3c235d560 2019-05-20)

$ cargo clippy --version
clippy 0.0.212 (265318d 2019-05-17)
$cargo clippy --verbose

error: internal compiler error: src/librustc/ty/subst.rs:546: Type parameter `T/#1` (T/1) out of range when substituting (root type=Some(T)) substs=[T]

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:570:9
note: Run with `RUST_BACKTRACE=1` environment variable to display 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.35.0 (3c235d560 2019-05-20) running on x86_64-unknown-linux-gnu

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

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

error: Could not compile `sized-chunks`.

Caused by:
  process didn't exit successfully: `/home/nirvdrum/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --edition=2018 --crate-name sized_chunks /home/nirvdrum/.cargo/registry/src/github.com-1ecc6299db9ec823/sized-chunks-0.3.0/src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=2e555744443ad819 -C extra-filename=-2e555744443ad819 --out-dir /home/nirvdrum/dev/workspaces/modern_compiler_implementation_in_ml-rust/chap09/target/debug/deps -L dependency=/home/nirvdrum/dev/workspaces/modern_compiler_implementation_in_ml-rust/chap09/target/debug/deps --extern typenum=/home/nirvdrum/dev/workspaces/modern_compiler_implementation_in_ml-rust/chap09/target/debug/deps/libtypenum-50d5605016bef7df.rmeta --cap-lints allow` (exit code: 101)
➜ env RUST_BACKTRACE=1 cargo clippy
    Checking sized-chunks v0.3.0
error: internal compiler error: src/librustc/ty/subst.rs:546: Type parameter `T/#1` (T/1) out of range when substituting (root type=Some(T)) substs=[T]

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:570:9
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 src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   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:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::span_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::span_bug_fmt
  14: <rustc::ty::subst::SubstFolder as rustc::ty::fold::TypeFolder>::fold_ty
  15: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
  16: <smallvec::SmallVec<A> as core::iter::traits::collect::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  17: rustc::ty::fold::TypeFoldable::fold_with
  18: rustc::traits::codegen::<impl rustc::ty::context::TyCtxt>::subst_and_normalize_erasing_regions
  19: rustc_mir::interpret::eval_context::InterpretCx<M>::resolve
  20: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpretCx<M>>::run
  21: rustc_mir::const_eval::eval_body_using_ecx
  22: rustc_mir::const_eval::const_eval_raw_provider
  23: rustc::ty::query::__query_compute::const_eval_raw
  24: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval_raw>::compute
  25: rustc::dep_graph::graph::DepGraph::with_task_impl
  26: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  27: rustc_mir::const_eval::const_eval_provider
  28: rustc::ty::query::__query_compute::const_eval
  29: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::const_eval>::compute
  30: rustc::dep_graph::graph::DepGraph::with_task_impl
  31: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  32: clippy_lints::consts::ConstEvalLateContext::expr
  33: clippy_lints::consts::ConstEvalLateContext::expr
  34: clippy_lints::consts::constant_simple
  35: clippy_lints::utils::hir_utils::SpanlessEq::eq_expr
  36: <clippy_lints::eq_op::EqOp as rustc::lint::LateLintPass>::check_expr
  37: <rustc::lint::context::LateLintPassObjects as rustc::lint::LateLintPass>::check_expr
  38: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  39: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_nested_body
  40: rustc::hir::intravisit::Visitor::visit_nested_impl_item
  41: rustc::hir::intravisit::walk_item
  42: rustc::hir::intravisit::Visitor::visit_nested_item
  43: rustc::hir::intravisit::walk_item
  44: rustc::hir::intravisit::Visitor::visit_nested_item
  45: rustc::hir::intravisit::walk_crate
  46: rustc::lint::context::late_lint_pass_crate
  47: rustc::lint::context::late_lint_crate
  48: rustc_data_structures::sync::serial_join
  49: rustc::util::common::time
  50: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  51: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  52: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  53: rustc_interface::passes::analysis::{{closure}}
  54: rustc::util::common::time
  55: rustc_interface::passes::analysis
  56: rustc::ty::query::__query_compute::analysis
  57: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::analysis>::compute
  58: rustc::dep_graph::graph::DepGraph::with_task_impl
  59: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  60: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  61: rustc_interface::passes::create_global_ctxt::{{closure}}
  62: rustc_interface::interface::run_compiler_in_existing_thread_pool
  63: std::thread::local::LocalKey<T>::with
  64: scoped_tls::ScopedKey<T>::set
  65: syntax::with_globals
query stack during panic:
#0 [const_eval_raw] const-evaluating `inline_array::InlineArray::<A, T>::HOST_SIZE`
#1 [const_eval] const-evaluating + checking `inline_array::InlineArray::<A, T>::HOST_SIZE`
#2 [analysis] running analysis passes on this crate
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.35.0 (3c235d560 2019-05-20) running on x86_64-unknown-linux-gnu

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

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

error: Could not compile `sized-chunks`.

To learn more, run the command again with --verbose.

Please let me know if you need any additional information.

@bodil
Copy link
Owner

bodil commented May 25, 2019

I've been having this same issue - it's a bug in Clippy, not sized-chunks, but it's the only crate I've found so far that's triggering it. It's probably something to do with type level numbers that Clippy is failing to keep up with, at a guess, but I haven't had time to look into it properly yet. I'll be filing a bug against Clippy when I do, but please let me know if you beat me to it. 😊

@nirvdrum
Copy link
Author

Thanks for clarifying. I went to file the issue on the clippy issue tracker, but it looks like someone beat me to it. You may want to subscribe to rust-lang/rust-clippy#4121 to track the status there.

@bodil
Copy link
Owner

bodil commented May 28, 2019

Oh, excellent, thanks for looking into it. I'll close this one, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants