Skip to content

Revert "Automatically defines the clippy feature" #1057

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

Merged
merged 1 commit into from
Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.

## 0.0.78 - TBA
* New lints: [`wrong_transmute`]
* For compatibility, `cargo clippy` does not defines the `clippy` feature
introduced in 0.0.76 anymore

## 0.0.77 — 2016-06-21
* Rustup to *rustc 1.11.0-nightly (5522e678b 2016-06-20)*
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ You can add options to `allow`/`warn`/`deny`:

Note: `deny` produces errors instead of warnings.

For convenience, `cargo clippy` automatically defines a `clippy` features. This
lets you set lints level and compile with or without clippy transparently:

```rust
#[cfg_attr(feature = "clippy", allow(needless_lifetimes))]
```

## Link with clippy service

`clippy-service` is a rust web initiative providing `rust-clippy` as a web service.
Expand Down
7 changes: 1 addition & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,11 @@ pub fn main() {
}
}
} else {
let mut args: Vec<String> = if env::args().any(|s| s == "--sysroot") {
let args: Vec<String> = if env::args().any(|s| s == "--sysroot") {
env::args().collect()
} else {
env::args().chain(Some("--sysroot".to_owned())).chain(Some(sys_root)).collect()
};

args.extend_from_slice(&["--cfg".to_owned(), r#"feature="clippy""#.to_owned()]);

let (result, _) = rustc_driver::run_compiler(&args, &mut ClippyCompilerCalls::new());

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's enough to leave out this line

if let Err(err_count) = result {
Expand Down Expand Up @@ -187,8 +184,6 @@ fn process<P, I>(old_args: I, dep_path: P, sysroot: &str) -> Result<(), i32>
args.push(String::from("--sysroot"));
args.push(sysroot.to_owned());
args.push("-Zno-trans".to_owned());
args.push("--cfg".to_owned());
args.push(r#"feature="clippy""#.to_owned());

let path = std::env::current_exe().expect("current executable path invalid");
let exit_status = std::process::Command::new("cargo")
Expand Down