title: Why should lifetime parameters be declared before type parameters?
body: <p>I was trying out a simple function when I got this compiler error. What is the actual reason behind this? In my case (following code), writing the type parameter before the lifetime parameter has no effect. Shouldn't the compiler know better?</p>
  
  <pre><code>use std::fmt::Debug;
  
  fn random_func&lt;T : Debug, 'a&gt;(parameter : &amp;'a mut T) {
      println!("{:?}", parameter);
  }
  
  fn main(){
      let mut name : String = "random".to_string();
      random_func(&amp;mut name);
      println!("{:?}", "compiled successfully");
  }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>life_time_trait.rs:3:27: 3:29 error: lifetime parameters must be declared prior to type parameters
  life_time_trait.rs:3 fn random_func&lt;T : Debug, 'a&gt;(parameter : &amp;'a mut T) {
  
                                             ^~
  </code></pre>