title: How to get index of macro repetition single element
body: <p>I need to get index of macro repetition element to write next code: 
  </p>
  
  <pre><code>struct A {
      data: [i32; 3]
  }
  
  macro_rules! tst {
      ( $( $n:ident ),* ) =&gt; {
          impl A {
              $(
                  fn $n(self) -&gt; i32 {
                      self.data[?] // here I need the index
                  }
              ),*
          }
      }
  }
  </code></pre>
  
  <p>I know one way to do it: just tell user to write index by hands:
  </p>
  
  <pre><code>( $( $i:ident =&gt; $n:ident ),* )
  </code></pre>
  
  <p>But is there a more elegant way which does not require user's action?</p>