arcnmx / cargo-clippy

cargo clippy
MIT License
68 stars 11 forks source link

ERROR: extra arguments to `rustc` ... #24

Closed cristianoliveira closed 8 years ago

cristianoliveira commented 8 years ago

Environment:

cargo clippy --release -- -Dclippy -Wclippy_pedantic --verbose                                    [ruby-2.2.1]
error: extra arguments to `rustc` can only be passed to one target, consider filtering
the package by passing e.g. `--lib` or `--bin NAME` to specify a single target
error: third party subcommand `cargo-clippy` exited unsuccessfully

To learn more, run the command again with --verbose.
arcnmx commented 8 years ago

Does it work if you pass the flags it asks for? (before the --)

cristianoliveira commented 8 years ago

Hey @arcnmx Thanks for answering so fast :)

Which option should I pass through it?

arcnmx commented 8 years ago

Depending on which part of your source you want to run the lint over, cargo clippy --lib or cargo clippy --bin BINARY_NAME_HERE. It can't do all at the same time for a multi-crate project, basically.

cristianoliveira commented 8 years ago

Even using it. :(

 cargo clippy --lib                                                                                                     [ruby-2.2.1]
error: extra arguments to `rustc` can only be passed to one target, consider filtering
the package by passing e.g. `--lib` or `--bin NAME` to specify a single target
error: third party subcommand `cargo-clippy` exited unsuccessfully

To learn more, run the command again with --verbose.
cristianoliveira commented 8 years ago

Do you have some practical example? I mean, some project that use it currently and the command that I should use.

arcnmx commented 8 years ago

That's correct. How did you install cargo-clippy?

cristianoliveira commented 8 years ago

I've downloaded this repo, compiled it and created a symbolic link to /usr/local/bin/cargo-clippy

arcnmx commented 8 years ago

Can you point to a specific codebase / github repo where you're encountering this problem? Also does which cargo-clippy point to /usr/local/bin/cargo-clippy?

cristianoliveira commented 8 years ago

The code I am trying to run on is this one: git clone git@github.com:cristianoliveira/funzzy.git

Where cargo-clippy is installed:

crosa@cristianoliveira ~/others/rust-clippy (master)$ 
which cargo-clippy
/usr/local/bin/cargo-clippy
arcnmx commented 8 years ago

works fine here on Linux... both:

cargo clippy --release --lib -- -Dclippy -Wclippy_pedantic --verbose
cargo clippy --release --bin funzzy -- -Dclippy -Wclippy_pedantic --verbose

However, you may just be better off checking out the new cargo-clippy: http://llogiq.github.io/2016/05/11/clippy.html

cristianoliveira commented 8 years ago

I've updated the nightly version of Rust to rustc 1.10.0-nightly (e0fd34bba 2016-05-09) and it worked :)