title: Type annotation required when using `as_ref()` in `assert_eq!()`
body: <p>I'm using the new generic conversion traits in my code and experience reduced ergonomics. The code in question implements <code>AsRef&lt;str&gt; for [Ascii]</code> as you can see in the example.</p>
  
  <p>Now I want to use <code>v.as_ref()</code> in <code>assert_eq!()</code> and expect that <code>v.as_ref()</code> returns a <code>&amp;str</code> using the provided implementation because the second argument to <code>assert_eq!()</code> is of type <code>&amp;str</code>.</p>
  
  <p>There is no implementation of <code>AsRef&lt;String&gt; for [Ascii]</code> so in my opinion only one implementation of <code>PartialEq</code> comes into play: <code>PartialEq&lt;str&gt; for &amp;str</code>.</p>
  
  <p>The compiler doesn't follow my explanation and complains about required type annotations. How can I avoid the explicit annotation and why can't the compiler figure out the correct implementation of <code>AsRef&lt;_&gt;</code>?</p>
  
  <p>Thanks</p>
  
  <pre><code>#![feature(convert)]
  
  struct Ascii { chr: u8 }
  
  impl AsRef&lt;str&gt; for [Ascii] {
      fn as_ref(&amp;self) -&gt; &amp;str {
          unsafe { ::std::mem::transmute(self) }
      }
  }
  
  fn main() {
      let v = [Ascii { chr: 65 }, Ascii { chr: 66 }];
      assert_eq!(v.as_ref(), "AB");
      // Workaround: explicit type annotation.
      //assert_eq!(AsRef::&lt;str&gt;::as_ref(&amp;v[..]), "AB");
  }
  </code></pre>
  
  <p>Playpen link: <a href="http://is.gd/ZcdqXZ" rel="noreferrer">http://is.gd/ZcdqXZ</a></p>
  
  <pre><code>&lt;anon&gt;:15:18: 15:26 error: type annotations required:
      cannot resolve `[Ascii] : core::convert::AsRef&lt;_&gt;` [E0283]
  &lt;anon&gt;:15     assert_eq!(v.as_ref(), "AB");
                         ^~~~~~~~
  </code></pre>