title: Is it possible to enable a rust feature only in test?
body: <p>Say I have crate A, B and I want to share a test helper function <code>helper()</code> in crate A to crate B, so I use a feature <code>test-utils</code>:</p>
  <pre><code>#[cfg(feature=&quot;test-utils&quot;)]
  pub fn helper(){
  
  }
  </code></pre>
  <p>So the problem is since the helper function contains modification of sensitive data in A, I don't want this function to be compiled in production, such as <code>cargo build --all-features</code>.</p>
  <p>Is there a way I can enable this feature only in test, and disable it in production？</p>