title: Conditional compilation in Rust 0.10?
body: <p>I have been using 0.10 and recently setup a build of nightly to experiment with Box and friends.</p>
  
  <p>Now I have code for 0.10 using <code>~str</code> and code for pre0.11 using <code>String</code> because of <code>to_owned</code> being obsolete. I thought I could do this:</p>
  
  <pre><code>#[cfg(rust_version = "0.10")]
  fn my_old_func() -&gt; Option&lt;~str&gt; {
  }
  
  #[cfg(not(rust_version = "0.10")]
  fn my_old_func() -&gt; Option&lt;String&gt; {
  }
  </code></pre>
  
  <p>And pass <code>--cfg rust_version:0.11</code> during compilation. But the compiler still chokes on the now removed <code>~</code> operator. Is there a way to have code that works under both 0.10 and the as yet unreleased 0.11 using conditional compilation or some other mechanism?</p>
  
  <p>I guess I could fall back to using cpp and #ifdef but that seems like stepping out of the Rust mindset.</p>