Skip to content

Commit 0f114ec

Browse files
committed
clarify the warning shown when optimizations are enabled
1 parent 4f8dc8f commit 0f114ec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tools/miri/src/bin/miri.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
9898
}
9999

100100
if tcx.sess.opts.optimize != OptLevel::No {
101-
tcx.dcx().warn("Miri does not support optimizations. If you have enabled optimizations \
102-
by selecting a Cargo profile (such as --release) which changes other profile settings \
103-
such as whether debug assertions and overflow checks are enabled, those settings are \
104-
still applied.");
101+
tcx.dcx().warn("Miri does not support optimizations: the opt-level is ignored. The only effect \
102+
of selecting a Cargo profile that enables optimizations (such as --release) is to apply \
103+
its remaining settings, such as whether debug assertions and overflow checks are enabled.");
105104
}
106105
if tcx.sess.mir_opt_level() > 0 {
107106
tcx.dcx().warn("You have explicitly enabled MIR optimizations, overriding Miri's default \

0 commit comments

Comments
 (0)