summary refs log tree commit diff
path: root/bin/clippy
diff options
context:
space:
mode:
Diffstat (limited to 'bin/clippy')
-rwxr-xr-xbin/clippy6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/clippy b/bin/clippy
index 6631f26..03f85c8 100755
--- a/bin/clippy
+++ b/bin/clippy
@@ -72,5 +72,11 @@ SUPPRESS=(
 # Needed or else clippy won't re-run on code that has already compiled.
 cargo clean
 
+# Need to set pass --sysroot for cargo-clippy manually.
+# cf. https://github.com/rust-lang/rust-clippy/issues/3523
+RUST_SYSROOT=$(rustc --print sysroot)
+RUSTFLAGS="${RUSTFLAGS:-}"
+export RUSTFLAGS="$RUSTFLAGS --sysroot=$RUST_SYSROOT"
+
 cargo clippy --all-features --all-targets -- ${SUPPRESS[@]/#/-Aclippy::} "$@" \
       -D warnings