diff --git a/cargo.sh b/cargo.sh
index 3e756696d9c..9b83deaf7ab 100755
--- a/cargo.sh
+++ b/cargo.sh
@@ -20,4 +20,4 @@ fi
 cmd=$1
 shift
 
-RUSTDOCFLAGS=$RUSTFLAGS cargo +${TOOLCHAIN} $cmd --target $TARGET_TRIPLE $@
+cargo +${TOOLCHAIN} $cmd --target $TARGET_TRIPLE $@
diff --git a/config.sh b/config.sh
index 9a745ad5952..902743d54c7 100644
--- a/config.sh
+++ b/config.sh
@@ -31,6 +31,7 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
 fi
 
 export RUSTFLAGS=$linker' -Cpanic=abort -Cdebuginfo=2 -Zpanic-abort-tests -Zcodegen-backend='$(pwd)'/target/'$CHANNEL'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
+export RUSTDOCFLAGS=$RUSTFLAGS
 
 # FIXME remove once the atomic shim is gone
 if [[ `uname` == 'Darwin' ]]; then