title: Playing with Rust's tuples
body: <p>Here's the link where was playing with Rust:</p>
  
  <p><a href="http://rustbyexample.com/match/guard.html" rel="nofollow">http://rustbyexample.com/match/guard.html</a></p>
  
  <p>I found Rust showing warnings for the case when i negate an unsigned variable, so executing code below ends with </p>
  
  <blockquote>
    <p>warning: negation of unsigned int variable may be unintentional</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>fn main() {
  let some = 2953495866u;
  let pair = (some, -some);
  // TODO ^ Try different values for `pair`
  
  println!("Tell me about {}", pair);
  // Match can be used to destructure a tuple
  match pair {
      // Destructure the tuple
      (x, y) if x == y =&gt; println!("These are twins"),
      // The ^ `if condition` part is a guard
      (x, y) if x + y == 0 =&gt; println!("Antimatter, kaboom!"),
      // `_` means don't bind the value to a variable
      (x, _) if x % 2 == 1 =&gt; println!("The first one is odd"),
      _ =&gt; println!("No correlation..."),
  }
  }
  </code></pre>
  
  <p>But when you change the code into somewhat like </p>
  
  <pre><code>let pair = (2953495866u, -2953495866);
  </code></pre>
  
  <p>it runs silently ending up with tuple of (2953495866, 18446744070756055750) what is 2 unsigned integers. As for me, i'd rather expect warning here about casting negative number into uint.</p>
  
  <p>What do you think about this situation?</p>