Skip to content

Commit 220df5f

Browse files
committed
Auto merge of #2385 - RalfJung:dev, r=RalfJung
use env vars, not Cargo.toml, to configure out dev profile This should fix the cargo warnings we are seeing in rustc.
2 parents b9c6771 + bfd148b commit 220df5f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ harness = false
5656
default = ["stack-cache"]
5757
stack-cache = []
5858

59-
[profile.dev]
60-
opt-level = 2 # because it's too slow otherwise
59+
# Be aware that this file is inside a workspace when used via the
60+
# submodule in the rustc repo. That means there are many cargo features
61+
# we cannot use, such as profiles.

miri

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,14 @@ fi
9696

9797
# Prepare flags for cargo and rustc.
9898
CARGO="cargo +$TOOLCHAIN"
99+
# Share target dir between `miri` and `cargo-miri`.
99100
if [ -z "$CARGO_TARGET_DIR" ]; then
100-
# Share target dir between `miri` and `cargo-miri`.
101101
export CARGO_TARGET_DIR="$MIRIDIR/target"
102102
fi
103+
# We configure dev builds to not be unusably slow.
104+
if [ -z "$CARGO_PROFILE_DEV_OPT_LEVEL" ]; then
105+
export CARGO_PROFILE_DEV_OPT_LEVEL=2
106+
fi
103107
# We set the rpath so that Miri finds the private rustc libraries it needs.
104108
export RUSTFLAGS="-C link-args=-Wl,-rpath,$LIBDIR $RUSTFLAGS"
105109

0 commit comments

Comments
 (0)