<p dir="auto">Sample code in question:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct MyStruct {
  x: i32,
}

fn foo(v: &amp;Vec&lt;i32&gt;, s: &amp;MyStruct) {

}

fn main() {
  let v1 = vec![];
  let v2 = vec![];

  foo(&amp;v1, &amp;v2);
}"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">MyStruct</span> <span class="pl-kos">{</span>
  <span class="pl-c1">x</span><span class="pl-kos">:</span> <span class="pl-smi">i32</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s1">v</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Vec</span><span class="pl-kos">&lt;</span><span class="pl-smi">i32</span><span class="pl-kos">&gt;</span><span class="pl-kos">,</span> <span class="pl-s1">s</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">MyStruct</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">let</span> v1 = <span class="pl-en">vec</span><span class="pl-en">!</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
  <span class="pl-k">let</span> v2 = <span class="pl-en">vec</span><span class="pl-en">!</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

  <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span>v1<span class="pl-kos">,</span> <span class="pl-c1">&amp;</span>v2<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">rustc correctly complains about the type of the second argument in the call to foo(), but then panics.</p>
<p dir="auto">Backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'rustc' panicked at 'index out of bounds: the len is 16 but the index is 18', ../src/libcollections\vec.rs:1362

stack backtrace:
   1:         0x66139105 - sys::backtrace::write::h2345dffb6069c92cLAs
   2:         0x661428ac - rt::unwind::register::heb8429a612e0fecdqfw
   3:         0x6610561f - rt::unwind::begin_unwind_inner::h3f101c489f219c5fzcw
   4:         0x66105f9a - rt::unwind::begin_unwind_fmt::he6ac4cfedf51005fFbw
   5:         0x661422c3 - rust_begin_unwind
   6:         0x6615ecd9 - panicking::panic_fmt::h99704e91012c930eH8B
   7:         0x6615a26c - panicking::panic_bounds_check::h8d3de3daf2e596c2N7B
   8:         0x65a5e907 - middle::infer::freshen::TypeFreshener&lt;'a, 'tcx&gt;.TypeFolder&lt;'tcx&gt;::fold_ty::hbca5c887c3745f43b5z
   9:         0x65a5fb4b - middle::infer::unify_key::ast..FloatTy.ToType&lt;'tcx&gt;::to_type::hb65f703f4a4fad8c7FA
  10:         0x659d3791 - middle::traits::select::SelectionContext&lt;'cx, 'tcx&gt;::select::hb3b2b18dad173700hkT
  11:         0x65aca7a7 - middle::traits::fulfill::FulfillmentContext&lt;'tcx&gt;::select_new_obligations::h12b24e6749072c24d8Q
  12:         0x65ac969c - middle::traits::fulfill::FulfillmentContext&lt;'tcx&gt;::select_where_possible::haaf097f39f0be13fM8Q
  13:           0x54d8aa - check::check_intrinsic_type::h3e6dfe9da166ee14yEt
  14:           0x5407aa - check::check_item_types::hd1042841d741e347tKn
  15:           0x53e7b6 - check::check_item_body::hc6836ce7ef602161ydo
  16:           0x540404 - check::check_item_types::hd1042841d741e347tKn
  17:           0x5f9752 - check_crate::h93d1a9d819c9d1819fD
  18:         0x6efa8ac9 - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  19:         0x6efa6f14 - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  20:         0x6efa1409 - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  21:         0x6ef82a66 - driver::compile_input::hd2fb89b180675596Tba
  22:         0x6f06460d - run_compiler::h282bf3c3999ca505x7b
  23:         0x6f062295 - run::h1c01070ec49f4ed0d7b
  24:         0x6f061bd9 - run::h1c01070ec49f4ed0d7b
  25:         0x6617d82c - rust_try
  26:         0x6617d809 - rust_try
  27:         0x6612d4d5 - rt::unwind::try::inner_try::h75b7bddb15a6c10cs8v
  28:         0x6f061d97 - run::h1c01070ec49f4ed0d7b
  29:         0x66140404 - sys::process::Command::cwd::heb9c93936e48371awUu
  30:     0x7ffb846b13d2 - BaseThreadInitThunk"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'index out of bounds: the len is 16 but the index is 18', ../src/libcollections\vec.rs:1362

stack backtrace:
   1:         0x66139105 - sys::backtrace::write::h2345dffb6069c92cLAs
   2:         0x661428ac - rt::unwind::register::heb8429a612e0fecdqfw
   3:         0x6610561f - rt::unwind::begin_unwind_inner::h3f101c489f219c5fzcw
   4:         0x66105f9a - rt::unwind::begin_unwind_fmt::he6ac4cfedf51005fFbw
   5:         0x661422c3 - rust_begin_unwind
   6:         0x6615ecd9 - panicking::panic_fmt::h99704e91012c930eH8B
   7:         0x6615a26c - panicking::panic_bounds_check::h8d3de3daf2e596c2N7B
   8:         0x65a5e907 - middle::infer::freshen::TypeFreshener&lt;'a, 'tcx&gt;.TypeFolder&lt;'tcx&gt;::fold_ty::hbca5c887c3745f43b5z
   9:         0x65a5fb4b - middle::infer::unify_key::ast..FloatTy.ToType&lt;'tcx&gt;::to_type::hb65f703f4a4fad8c7FA
  10:         0x659d3791 - middle::traits::select::SelectionContext&lt;'cx, 'tcx&gt;::select::hb3b2b18dad173700hkT
  11:         0x65aca7a7 - middle::traits::fulfill::FulfillmentContext&lt;'tcx&gt;::select_new_obligations::h12b24e6749072c24d8Q
  12:         0x65ac969c - middle::traits::fulfill::FulfillmentContext&lt;'tcx&gt;::select_where_possible::haaf097f39f0be13fM8Q
  13:           0x54d8aa - check::check_intrinsic_type::h3e6dfe9da166ee14yEt
  14:           0x5407aa - check::check_item_types::hd1042841d741e347tKn
  15:           0x53e7b6 - check::check_item_body::hc6836ce7ef602161ydo
  16:           0x540404 - check::check_item_types::hd1042841d741e347tKn
  17:           0x5f9752 - check_crate::h93d1a9d819c9d1819fD
  18:         0x6efa8ac9 - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  19:         0x6efa6f14 - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  20:         0x6efa1409 - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  21:         0x6ef82a66 - driver::compile_input::hd2fb89b180675596Tba
  22:         0x6f06460d - run_compiler::h282bf3c3999ca505x7b
  23:         0x6f062295 - run::h1c01070ec49f4ed0d7b
  24:         0x6f061bd9 - run::h1c01070ec49f4ed0d7b
  25:         0x6617d82c - rust_try
  26:         0x6617d809 - rust_try
  27:         0x6612d4d5 - rt::unwind::try::inner_try::h75b7bddb15a6c10cs8v
  28:         0x6f061d97 - run::h1c01070ec49f4ed0d7b
  29:         0x66140404 - sys::process::Command::cwd::heb9c93936e48371awUu
  30:     0x7ffb846b13d2 - BaseThreadInitThunk
</code></pre></div>
<p dir="auto">Version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.2.0 (082e47636 2015-08-03)
binary: rustc
commit-hash: 082e4763615bdbe7b4dd3dfd6fc2210b7773edf5
commit-date: 2015-08-03
host: x86_64-pc-windows-gnu
release: 1.2.0"><pre class="notranslate"><code class="notranslate">rustc 1.2.0 (082e47636 2015-08-03)
binary: rustc
commit-hash: 082e4763615bdbe7b4dd3dfd6fc2210b7773edf5
commit-date: 2015-08-03
host: x86_64-pc-windows-gnu
release: 1.2.0
</code></pre></div>
<p dir="auto">Playpen link: <a href="http://is.gd/LITiE8" rel="nofollow">http://is.gd/LITiE8</a><br>
Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="use std::collections::HashSet;

fn main() {
    let mut v = Vec::new();
    foo(&amp;mut v);
}

fn foo(h: &amp;mut HashSet&lt;u32&gt;) {
}"><pre class="notranslate"><code class="notranslate">use std::collections::HashSet;

fn main() {
    let mut v = Vec::new();
    foo(&amp;mut v);
}

fn foo(h: &amp;mut HashSet&lt;u32&gt;) {
}
</code></pre></div>
<p dir="auto">Output from playpen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;anon&gt;:5:9: 5:15 error: mismatched types:
 expected `&amp;mut std::collections::hash::set::HashSet&lt;u32&gt;`,
    found `&amp;mut collections::vec::Vec&lt;_&gt;`
(expected struct `std::collections::hash::set::HashSet`,
    found struct `collections::vec::Vec`) [E0308]
&lt;anon&gt;:5     foo(&amp;mut v);
                 ^~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 3 but the index is 3', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libcollections/vec.rs:1358


playpen: application terminated with error code 101
Program ended."><pre class="notranslate"><code class="notranslate">&lt;anon&gt;:5:9: 5:15 error: mismatched types:
 expected `&amp;mut std::collections::hash::set::HashSet&lt;u32&gt;`,
    found `&amp;mut collections::vec::Vec&lt;_&gt;`
(expected struct `std::collections::hash::set::HashSet`,
    found struct `collections::vec::Vec`) [E0308]
&lt;anon&gt;:5     foo(&amp;mut v);
                 ^~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 3 but the index is 3', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libcollections/vec.rs:1358


playpen: application terminated with error code 101
Program ended.
</code></pre></div>
<p dir="auto">Happens for me on <code class="notranslate">rustc 1.1.0-nightly (f9e53c7f2 2015-04-24) (built 2015-04-25)</code>, and playpen is using beta, so it happens on that as well.</p>