Rust-clippy: crashes while checking dependency

Created on 31 Mar 2018  路  5Comments  路  Source: rust-lang/rust-clippy

clippy 0.0.191
project: http://github.com/matthiaskrgr/cargo-rebuild-check
Previous behaviour:
I could run "cargo clippy" and the project was being checked normally.
When running "cargo clippy" on the rust-lang/cargo, there would be a crash.
When running "cargo build; cargo clippy", first cargo would build my project and then when running "cargo clippy", only check the root crates source code.

Current behaviour
clippy crashes while checking cargo-rebuild-check
clippy still crashes on rust-lang/cargo
when I run "cargo build; cargo clippy", on my project, it builds fine, however post-build clippy invocation would rebuild all the dependency crates as well and then crash on cargo (same stacktrace as in rust-lang/cargo).

It seems that under the hood clippy now analyses all dependency crates as well, which it did not do a few days ago?

Crash trace:
Fresh git2 v0.6.11 Fresh docopt v0.8.3 Fresh crates-io v0.14.0 Fresh git2-curl v0.7.0 Compiling cargo v0.25.0 Running `/home/matthias/.cargo/bin/clippy-driver rustc --crate-name cargo /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.25.0/src/cargo/lib.rs --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=8fba7e9abc972115 -C extra-filename=-8fba7e9abc972115 --out-dir /home/matthias/cargo-rebuild-check/target/debug/deps -L dependency=/home/matthias/cargo-rebuild-check/target/debug/deps --extern tempdir=/home/matthias/cargo-rebuild-check/target/debug/deps/libtempdir-86ee6890ad134369.rmeta --extern libc=/home/matthias/cargo-rebuild-check/target/debug/deps/liblibc-c9af13b079129243.rmeta --extern log=/home/matthias/cargo-rebuild-check/target/debug/deps/liblog-50b824794ce979f3.rmeta --extern glob=/home/matthias/cargo-rebuild-check/target/debug/deps/libglob-98af0d51cb34026e.rmeta --extern same_file=/home/matthias/cargo-rebuild-check/target/debug/deps/libsame_file-a65519121a71b87e.rmeta --extern crypto_hash=/home/matthias/cargo-rebuild-check/target/debug/deps/libcrypto_hash-9190d757f526f26e.rmeta --extern curl=/home/matthias/cargo-rebuild-check/target/debug/deps/libcurl-75a6bdc18cae13da.rmeta --extern tar=/home/matthias/cargo-rebuild-check/target/debug/deps/libtar-ece64d6a12d83fe0.rmeta --extern termcolor=/home/matthias/cargo-rebuild-check/target/debug/deps/libtermcolor-12252bc15df3cd6f.rmeta --extern git2=/home/matthias/cargo-rebuild-check/target/debug/deps/libgit2-807749a5da1d28bf.rmeta --extern serde_derive=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde_derive-51b23b86f64a4a99.so --extern crossbeam=/home/matthias/cargo-rebuild-check/target/debug/deps/libcrossbeam-fff707715e808f6f.rmeta --extern ignore=/home/matthias/cargo-rebuild-check/target/debug/deps/libignore-0aa36186c1962271.rmeta --extern scoped_tls=/home/matthias/cargo-rebuild-check/target/debug/deps/libscoped_tls-11ca84d5cb90c8ce.rmeta --extern home=/home/matthias/cargo-rebuild-check/target/debug/deps/libhome-4b5b9b3a6a679c2f.rmeta --extern hex=/home/matthias/cargo-rebuild-check/target/debug/deps/libhex-93888f0b3e2eacda.rmeta --extern filetime=/home/matthias/cargo-rebuild-check/target/debug/deps/libfiletime-fa37518a0a425e23.rmeta --extern crates_io=/home/matthias/cargo-rebuild-check/target/debug/deps/libcrates_io-cefeedff162abf82.rmeta --extern libgit2_sys=/home/matthias/cargo-rebuild-check/target/debug/deps/liblibgit2_sys-2dffd842c89e83c0.rmeta --extern num_cpus=/home/matthias/cargo-rebuild-check/target/debug/deps/libnum_cpus-c4404f209446de68.rmeta --extern serde_ignored=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde_ignored-95a04496656ea5ee.rmeta --extern jobserver=/home/matthias/cargo-rebuild-check/target/debug/deps/libjobserver-a5a04087d76bc790.rmeta --extern shell_escape=/home/matthias/cargo-rebuild-check/target/debug/deps/libshell_escape-74410135dd3b471c.rmeta --extern docopt=/home/matthias/cargo-rebuild-check/target/debug/deps/libdocopt-f7b3c62b6c66d950.rmeta --extern toml=/home/matthias/cargo-rebuild-check/target/debug/deps/libtoml-98c0908bc6ef4f71.rmeta --extern url=/home/matthias/cargo-rebuild-check/target/debug/deps/liburl-3c056d0f7e5d63ac.rmeta --extern serde_json=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde_json-8a6529a6bbee49a3.rmeta --extern flate2=/home/matthias/cargo-rebuild-check/target/debug/deps/libflate2-002bd68b3cbb7eab.rmeta --extern failure=/home/matthias/cargo-rebuild-check/target/debug/deps/libfailure-0960267920f54b4b.rmeta --extern semver=/home/matthias/cargo-rebuild-check/target/debug/deps/libsemver-21b59d4801f34ce9.rmeta --extern fs2=/home/matthias/cargo-rebuild-check/target/debug/deps/libfs2-ed4fd1ae7df3fa12.rmeta --extern env_logger=/home/matthias/cargo-rebuild-check/target/debug/deps/libenv_logger-a42e7f2b753264b6.rmeta --extern serde=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde-7f3c3f4978526e9e.rmeta --extern atty=/home/matthias/cargo-rebuild-check/target/debug/deps/libatty-2dfc8dd740cf7f4c.rmeta --extern git2_curl=/home/matthias/cargo-rebuild-check/target/debug/deps/libgit2_curl-105bf6da56b7efa2.rmeta --cap-lints allow -C target-cpu=native -L native=/usr/lib -L native=/usr/lib -L native=/home/matthias/cargo-rebuild-check/target/debug/build/backtrace-sys-77fe771382dcdc3a/out/.libs -L native=/home/matthias/cargo-rebuild-check/target/debug/build/miniz-sys-57e5cf5320b6d8c1/out -L native=/home/matthias/cargo-rebuild-check/target/debug/build/libgit2-sys-648b28da08df7df1/out/lib -L native=/usr/lib` error: internal compiler error: librustc/infer/region_constraints/mod.rs:695: cannot relate bound region: ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(1:887), 'a)) <= ReScope(Remainder(BlockRemainder { block: ItemLocalId(644), first_statement_index: 0 })) thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:488:9 note: Run with `RUST_BACKTRACE=1` for 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.26.0-nightly (80785a547 2018-03-30) running on x86_64-unknown-linux-gnu note: compiler flags: -C debuginfo=2 -C target-cpu=native --crate-type lib note: some of the compiler flags provided by cargo are hidden error: Could not compile `cargo`. Caused by: process didn't exit successfully: `/home/matthias/.cargo/bin/clippy-driver rustc --crate-name cargo /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.25.0/src/cargo/lib.rs --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=8fba7e9abc972115 -C extra-filename=-8fba7e9abc972115 --out-dir /home/matthias/cargo-rebuild-check/target/debug/deps -L dependency=/home/matthias/cargo-rebuild-check/target/debug/deps --extern tempdir=/home/matthias/cargo-rebuild-check/target/debug/deps/libtempdir-86ee6890ad134369.rmeta --extern libc=/home/matthias/cargo-rebuild-check/target/debug/deps/liblibc-c9af13b079129243.rmeta --extern log=/home/matthias/cargo-rebuild-check/target/debug/deps/liblog-50b824794ce979f3.rmeta --extern glob=/home/matthias/cargo-rebuild-check/target/debug/deps/libglob-98af0d51cb34026e.rmeta --extern same_file=/home/matthias/cargo-rebuild-check/target/debug/deps/libsame_file-a65519121a71b87e.rmeta --extern crypto_hash=/home/matthias/cargo-rebuild-check/target/debug/deps/libcrypto_hash-9190d757f526f26e.rmeta --extern curl=/home/matthias/cargo-rebuild-check/target/debug/deps/libcurl-75a6bdc18cae13da.rmeta --extern tar=/home/matthias/cargo-rebuild-check/target/debug/deps/libtar-ece64d6a12d83fe0.rmeta --extern termcolor=/home/matthias/cargo-rebuild-check/target/debug/deps/libtermcolor-12252bc15df3cd6f.rmeta --extern git2=/home/matthias/cargo-rebuild-check/target/debug/deps/libgit2-807749a5da1d28bf.rmeta --extern serde_derive=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde_derive-51b23b86f64a4a99.so --extern crossbeam=/home/matthias/cargo-rebuild-check/target/debug/deps/libcrossbeam-fff707715e808f6f.rmeta --extern ignore=/home/matthias/cargo-rebuild-check/target/debug/deps/libignore-0aa36186c1962271.rmeta --extern scoped_tls=/home/matthias/cargo-rebuild-check/target/debug/deps/libscoped_tls-11ca84d5cb90c8ce.rmeta --extern home=/home/matthias/cargo-rebuild-check/target/debug/deps/libhome-4b5b9b3a6a679c2f.rmeta --extern hex=/home/matthias/cargo-rebuild-check/target/debug/deps/libhex-93888f0b3e2eacda.rmeta --extern filetime=/home/matthias/cargo-rebuild-check/target/debug/deps/libfiletime-fa37518a0a425e23.rmeta --extern crates_io=/home/matthias/cargo-rebuild-check/target/debug/deps/libcrates_io-cefeedff162abf82.rmeta --extern libgit2_sys=/home/matthias/cargo-rebuild-check/target/debug/deps/liblibgit2_sys-2dffd842c89e83c0.rmeta --extern num_cpus=/home/matthias/cargo-rebuild-check/target/debug/deps/libnum_cpus-c4404f209446de68.rmeta --extern serde_ignored=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde_ignored-95a04496656ea5ee.rmeta --extern jobserver=/home/matthias/cargo-rebuild-check/target/debug/deps/libjobserver-a5a04087d76bc790.rmeta --extern shell_escape=/home/matthias/cargo-rebuild-check/target/debug/deps/libshell_escape-74410135dd3b471c.rmeta --extern docopt=/home/matthias/cargo-rebuild-check/target/debug/deps/libdocopt-f7b3c62b6c66d950.rmeta --extern toml=/home/matthias/cargo-rebuild-check/target/debug/deps/libtoml-98c0908bc6ef4f71.rmeta --extern url=/home/matthias/cargo-rebuild-check/target/debug/deps/liburl-3c056d0f7e5d63ac.rmeta --extern serde_json=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde_json-8a6529a6bbee49a3.rmeta --extern flate2=/home/matthias/cargo-rebuild-check/target/debug/deps/libflate2-002bd68b3cbb7eab.rmeta --extern failure=/home/matthias/cargo-rebuild-check/target/debug/deps/libfailure-0960267920f54b4b.rmeta --extern semver=/home/matthias/cargo-rebuild-check/target/debug/deps/libsemver-21b59d4801f34ce9.rmeta --extern fs2=/home/matthias/cargo-rebuild-check/target/debug/deps/libfs2-ed4fd1ae7df3fa12.rmeta --extern env_logger=/home/matthias/cargo-rebuild-check/target/debug/deps/libenv_logger-a42e7f2b753264b6.rmeta --extern serde=/home/matthias/cargo-rebuild-check/target/debug/deps/libserde-7f3c3f4978526e9e.rmeta --extern atty=/home/matthias/cargo-rebuild-check/target/debug/deps/libatty-2dfc8dd740cf7f4c.rmeta --extern git2_curl=/home/matthias/cargo-rebuild-check/target/debug/deps/libgit2_curl-105bf6da56b7efa2.rmeta --cap-lints allow -C target-cpu=native -L native=/usr/lib -L native=/usr/lib -L native=/home/matthias/cargo-rebuild-check/target/debug/build/backtrace-sys-77fe771382dcdc3a/out/.libs -L native=/home/matthias/cargo-rebuild-check/target/debug/build/miniz-sys-57e5cf5320b6d8c1/out -L native=/home/matthias/cargo-rebuild-check/target/debug/build/libgit2-sys-648b28da08df7df1/out/lib -L native=/usr/lib` (exit code: 101)
cargo-clippy 0.0.191 cargo 1.26.0-nightly (d63299b6e 2018-03-28) rustc 1.26.0-nightly (80785a547 2018-03-30)

L-crash

Most helpful comment

I'm also hitting this (with hyper v0.10.13 as one of my dependencies).

I found a thoroughly silly workaround, though. If you run cargo check before running cargo clippy, then clippy will not try to rebuild your dependencies, bypassing this bug.

All 5 comments

I see the similar problem with latest clippy:

error: aborting due to previous error

error: Could not compile `our_skia_sys`.
warning: build failed, waiting for other jobs to finish...
error: internal compiler error: librustc/ty/context.rs:502: node_id_to_type: no type for node `expr 10 (id=631)`

thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:543:9

For me this happens while checking hyper-0.9.18 dependency.

I also met this problem, I bisected it to 66a98d2658997ad8ede2939e68222bd4df626718 , cc @oli-obk

I'm also hitting this (with hyper v0.10.13 as one of my dependencies).

I found a thoroughly silly workaround, though. If you run cargo check before running cargo clippy, then clippy will not try to rebuild your dependencies, bypassing this bug.

Hi, I'm closing this since I can no longer reproduce. :)

Was this page helpful?
0 / 5 - 0 ratings