Skip to content

Commit 062b660

Browse files
committed
Auto merge of rust-lang#2283 - RalfJung:color, r=RalfJung
revert --color=always changes They [cause problems](rust-lang/miri#2277) and they completely break rendering on the playground: ``` Compiling playground v0.0.1 (/playground) Finished dev [unoptimized + debuginfo] target(s) in 0.47s Running `/playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri target/miri/x86_64-unknown-linux-gnu/debug/playground` �[0m�[1m�[38;5;9merror[E0277]�[0m�[0m�[1m: `*mut std::sync::atomic::AtomicUsize` cannot be sent between threads safely�[0m �[0m �[0m�[0m�[1m�[38;5;12m--> �[0m�[0msrc/main.rs:17:18�[0m �[0m �[0m�[0m�[1m�[38;5;12m|�[0m �[0m�[1m�[38;5;12m17�[0m�[0m �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m let j1 = spawn(move || {�[0m �[0m �[0m�[0m�[1m�[38;5;12m| �[0m�[0m �[0m�[0m�[1m�[38;5;12m__________________�[0m�[0m�[1m�[38;5;9m^^^^^�[0m�[0m�[1m�[38;5;12m_-�[0m �[0m �[0m�[0m�[1m�[38;5;12m| �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m�[1m�[38;5;9m|�[0m �[0m �[0m�[0m�[1m�[38;5;12m| �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m�[1m�[38;5;9m`*mut std::sync::atomic::AtomicUsize` cannot be sent between threads safely�[0m �[0m�[1m�[38;5;12m18�[0m�[0m �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m *(c.0 as *mut usize) = 32;�[0m �[0m�[1m�[38;5;12m19�[0m�[0m �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m�[1m�[38;5;12m|�[0m�[0m �[0m�[0m });�[0m �[0m �[0m�[0m�[1m�[38;5;12m| �[0m�[0m�[1m�[38;5;12m|_________-�[0m�[0m �[0m�[0m�[1m�[38;5;12mwithin this `[closure@src/main.rs:17:24: 19:10]`�[0m �[0m �[0m�[0m�[1m�[38;5;12m|�[0m ``` Sorry `@saethlin,` I think we need to go back to start here and consider another solution. Fixes rust-lang/miri#2277
2 parents 63d6605 + 6f7c0c0 commit 062b660

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

cargo-miri/bin.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -952,17 +952,8 @@ fn phase_runner(binary: &Path, binary_args: env::Args, phase: RunnerPhase) {
952952
assert!(suffix.starts_with('='));
953953
// Drop this argument.
954954
} else if let Some(suffix) = arg.strip_prefix(json_flag) {
955-
let suffix = suffix.strip_prefix('=').unwrap();
956-
// This is how we pass through --color=always. We detect that Cargo is detecting rustc
957-
// to emit the diagnostic structure that Cargo would consume from rustc to emit colored
958-
// diagnostics, and ask rustc to emit them.
959-
// See https://github.com/rust-lang/miri/issues/2037
960-
// First skip over the leading `=`, then check for diagnostic-rendered-ansi in the
961-
// comma-separated list
962-
if suffix.split(',').any(|a| a == "diagnostic-rendered-ansi") {
963-
cmd.arg("--color=always");
964-
}
965-
// But aside from remembering that colored output was requested, drop this argument.
955+
assert!(suffix.starts_with('='));
956+
// Drop this argument.
966957
} else {
967958
cmd.arg(arg);
968959
}

0 commit comments

Comments
 (0)