title: How to redirect child process output to stderr?
body: <p>I am trying to start a process with the <a href="https://doc.rust-lang.org/std/process/struct.Command.html" rel="nofollow noreferrer"><code>Command</code></a> API and redirect its standard output to standard error. The following fails:</p>
  
  <pre><code>Command::new("tput").arg("rc")
      .stdout(io::stderr())
      .status()
      .expect("failed to run tput");
  </code></pre>
  
  <p>because <code>Command::new("tput").arg("rc").stdout(&lt;XXX&gt;)</code> expects a <code>std::process::Stdio</code>:</p>
  
  <pre class="lang-none prettyprint-override"><code>expected struct `std::process::Stdio`, found struct `std::io::Stderr`
  </code></pre>
  
  <p>The equivalent in Bash would probably be <code>tput rc &gt; /dev/stderr</code>.</p>
  
  <p>I would like to know how to do this properly.</p>