From: Aleksey Kladov Date: Thu, 8 Mar 2018 20:24:27 +0000 (+0300) Subject: Fix `--explain` X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~47^2~26 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cc3ce0007d734c186111c5f451940ba0ce6b5fe3;p=cargo.git Fix `--explain` --- diff --git a/src/bin/cli/mod.rs b/src/bin/cli/mod.rs index bd1585358..078ec624a 100644 --- a/src/bin/cli/mod.rs +++ b/src/bin/cli/mod.rs @@ -49,6 +49,12 @@ pub fn do_main(config: &mut Config) -> CliResult { return Ok(()); } + if let Some(ref code) = args.value_of("explain") { + let mut procss = config.rustc()?.process(); + procss.arg("--explain").arg(code).exec()?; + return Ok(()); + } + if args.is_present("list") { println!("Installed Commands:"); for command in list_commands(config) { diff --git a/tests/testsuite/cargo_command.rs b/tests/testsuite/cargo_command.rs index 598f5a717..7944fbeed 100644 --- a/tests/testsuite/cargo_command.rs +++ b/tests/testsuite/cargo_command.rs @@ -214,5 +214,6 @@ fn cargo_help() { #[test] fn explain() { assert_that(cargo_process().arg("--explain").arg("E0001"), - execs().with_status(0)); + execs().with_status(0).with_stdout_contains("\ +This error suggests that the expression arm corresponding to the noted pattern")); }