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

Attempting to run clippy on a single file causes it to crash #2001

Closed
PhilipDaniels opened this issue Aug 29, 2017 · 6 comments
Closed

Attempting to run clippy on a single file causes it to crash #2001

PhilipDaniels opened this issue Aug 29, 2017 · 6 comments

Comments

@PhilipDaniels
Copy link

PhilipDaniels commented Aug 29, 2017

Example:

cargo clippy runtime_data.rs

results in

   Compiling qork v0.1.0 (file:///data/qork/qork/src/rust/qork)
    error: multiple input filenames provided

    thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc/session/mod.rs:824:4
    note: Run with `RUST_BACKTRACE=1` for a backtrace.
    thread 'main' panicked at 'rustc_thread failed: Any', /checkout/src/libcore/result.rs:906:4
    error: Could not compile `qork`.

With the backtrace, we get

   Compiling qork v0.1.0 (file:///data/qork/qork/src/rust/qork)
error: multiple input filenames provided

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc/session/mod.rs:824:4
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:397
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic
   6: rustc::session::early_error
   7: <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::no_input
   8: <cargo_clippy::ClippyCompilerCalls as rustc_driver::CompilerCalls<'a>>::no_input
   9: rustc_driver::run_compiler
thread 'main' panicked at 'rustc_thread failed: Any', /checkout/src/libcore/result.rs:906:4
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:397
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:572
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::result::unwrap_failed
  10: cargo_clippy::main
  11: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:99
  12: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:459
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:61
  13: __libc_start_main
  14: _start
error: Could not compile `qork`.




@mati865
Copy link
Contributor

mati865 commented Jan 3, 2019

For what it's worth Clippy doesn't crash anymore:

$ cargo clippy utils.rs
error: Found argument 'utils.rs' which wasn't expected, or isn't valid in this context

USAGE:
    cargo check [OPTIONS]

For more information try --help

$ cargo clippy -- utils.rs
    Checking proptest-arbitrary v0.2.1 (/tmp/clippy/proptest-arbitrary)
error: multiple input filenames provided

error: Could not compile `proptest-arbitrary`.

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

@epompeii
Copy link

@camsteffen was this resolved or just closed?
If resolved, would you be able to point me to the appropriate pull request?

@camsteffen
Copy link
Contributor

Sorry I don't know when it was fixed.

@smallB007
Copy link

It still crashes.
user@user-desktop ~/D/P/r/> cargo clippy -- src/main.rs
error: failed to run rustc to learn about target-specific information

Caused by:
process didn't exit successfully: /home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/clippy-driver rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg (exit status: 1)
--- stderr
error: multiple input filenames provided (first two filenames are - and src/main.rs)

@sanmai-NL
Copy link
Contributor

Triage: still the same.

@sanmai-NL
Copy link
Contributor

@camsteffen

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

6 participants