Cannot compile my project due to dependence on clippy


I am using stable version of rustc 1.15.1. I have a project that I have been working on for quite a while, and it compiled fine before (always with a stable rust compiler). Somehow I cleared Cargo.lock for my project today. So when I run ‘cargo build’, it tries to update registry, and recompiles all the dependencies. I got an error like this:

error[E0554]: #[feature] may not be used on the stable release channel
 --> /Users/qinsoon/.cargo/registry/src/
3 | #![feature(box_syntax)]
  | ^^^^^^^^^^^^^^^^^^^^^^^

I do not have any dependency on clippy directly in my project. However, I suspect some crates I use may depend on clippy. I tried to use cargo list to show all the dependencies of my project (including transitive dependencies), and I didn’t find clippy there as well.

As building my project always tries to compile clippy v0.0.112 (v0.0.114 is the lastest version), I am pretty sure somehow my project depends on clippy. (I have tried to delete and reinstall cargo, including its cache and registry for dependencies. I have pulled my project from repo, and build freshly – still failing)

I am wondering:

  1. since compiling clippy should always require a nightly compiler, how is it possible that my project can compile before? The possible answer is that
  2. do I have to switch to beta/nightly compiler for dependency on clippy?

Thanks a lot.


What is the contents of your Cargo.toml and Cargo.lock?


I have a dependency on doubly, which depends on clippy. I think this is the reason.

This is from Cargo.lock

name = "doubly"
version = "1.1.2"
source = "registry+"
dependencies = [
 "clippy 0.0.112 (registry+",

name = "clippy"
version = "0.0.112"
source = "registry+"
dependencies = [
 "cargo_metadata 0.1.2 (registry+",
 "clippy_lints 0.0.112 (registry+",

name = "clippy_lints"
version = "0.0.112"
source = "registry+"
dependencies = [
 "matches 0.1.4 (registry+",
 "quine-mc_cluskey 0.2.4 (registry+",
 "regex-syntax 0.4.0 (registry+",
 "semver 0.2.3 (registry+",
 "toml 0.2.1 (registry+",
 "unicode-normalization 0.1.4 (registry+",


Ah, yes, this is actually a bug in the doubly crate.

Per the Good practices for Writing Rust Libraries page, you’ll see that a crate author should specify a dependency on clippy like this:

clippy = {version = "0.0.21", optional = true}

default = []
dev = ["clippy"]

You should consider filing an issue on the doubly project’s GitHub page and ask them to please consider making clippy optional per the page I linked above.


Thank you very much. This helps a lot. I’ll file an issue for doubly.