<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait Mirror { type It; }
impl&lt;T&gt; Mirror for T { type It = Self; }
#[repr(C)] pub struct S;
extern {
   pub fn f(s:*mut &lt;S as Mirror&gt;::It);
}
fn main() {}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">Mirror</span> <span class="pl-kos">{</span> <span class="pl-k">type</span> <span class="pl-smi">It</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">impl</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-smi">Mirror</span> <span class="pl-k">for</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span> <span class="pl-k">type</span> <span class="pl-smi">It</span> = <span class="pl-smi">Self</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>repr<span class="pl-kos">(</span><span class="pl-v">C</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">S</span><span class="pl-kos">;</span>
<span class="pl-k">extern</span> <span class="pl-kos">{</span>
   <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-s1">s</span><span class="pl-kos">:</span><span class="pl-c1">*</span><span class="pl-k">mut</span> &lt;<span class="pl-smi">S</span> <span class="pl-k">as</span> <span class="pl-smi">Mirror</span>&gt;<span class="pl-kos">::</span><span class="pl-smi">It</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-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: type_of with ty_projection"><pre class="notranslate"><code class="notranslate">error: internal compiler error: type_of with ty_projection
</code></pre></div>
<p dir="auto">It's apparently crashing in trans.  Tested on nightly.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: type_of with ty_projection
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 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:190

stack backtrace:
   1:     0x7fab454c2034 - sys::backtrace::write::he62bcb548164e961YyC
   2:     0x7fab454e7df8 - panicking::on_panic::h3cb4936e695d67bdOGI
   3:     0x7fab4541efaa - rt::unwind::begin_unwind_inner::hfe13dbe91daef70cmnI
   4:     0x7fab428bd41d - rt::unwind::begin_unwind::h10911018176195016387
   5:     0x7fab428bdc65 - diagnostic::Handler::bug::h3c5d38abd490322elgB
   6:     0x7fab432d507b - session::Session::bug::h23eaba6d447e27ca3yn
   7:     0x7fab44b5f17f - trans::type_of::in_memory_type_of::hd518d125e463ffd5lEo
   8:     0x7fab44b5ef41 - trans::type_of::in_memory_type_of::hd518d125e463ffd5lEo
   9:     0x7fab44c61137 - trans::foreign::foreign_signature::h4618e8fc5486898feOB
  10:     0x7fab44c60603 - trans::foreign::foreign_types_for_fn_ty::hbb4f8804cec19fffKPB
  11:     0x7fab44c15e2f - trans::foreign::register_rust_fn_with_foreign_abi::hff88e81da38aeb0f6gB
  12:     0x7fab44b1e905 - trans::base::get_item_val::hfbaf01eba019b69eVnu
  13:     0x7fab44b1bb50 - trans::base::trans_item::h1506a2e4228c48caCSt
  14:     0x7fab44c1859c - trans::base::trans_crate::h6ca4511310a24dc9fPu
  15:     0x7fab45af55c3 - driver::phase_4_translate_to_llvm::h44ad816874743241kOa
  16:     0x7fab45ad11b3 - driver::compile_input::h3bad48bfc23f6006Rba
  17:     0x7fab45b88b02 - run_compiler::haa99afb1c99d7db1x2b
  18:     0x7fab45b8694c - thunk::F.Invoke&lt;A, R&gt;::invoke::h10898031602178947258
  19:     0x7fab45b859d0 - rt::unwind::try::try_fn::h4687345873392121579
  20:     0x7fab45558fc8 - rust_try_inner
  21:     0x7fab45558fb5 - rust_try
  22:     0x7fab45b85e76 - thunk::F.Invoke&lt;A, R&gt;::invoke::h18058446263424162958
  23:     0x7fab454d69f5 - sys::thread::thread_start::h8ed6b7636995fe24B1G
  24:     0x7fab3f39e373 - start_thread
  25:     0x7fab450a027c - __clone
  26:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">error: internal compiler error: type_of with ty_projection
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 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:190

stack backtrace:
   1:     0x7fab454c2034 - sys::backtrace::write::he62bcb548164e961YyC
   2:     0x7fab454e7df8 - panicking::on_panic::h3cb4936e695d67bdOGI
   3:     0x7fab4541efaa - rt::unwind::begin_unwind_inner::hfe13dbe91daef70cmnI
   4:     0x7fab428bd41d - rt::unwind::begin_unwind::h10911018176195016387
   5:     0x7fab428bdc65 - diagnostic::Handler::bug::h3c5d38abd490322elgB
   6:     0x7fab432d507b - session::Session::bug::h23eaba6d447e27ca3yn
   7:     0x7fab44b5f17f - trans::type_of::in_memory_type_of::hd518d125e463ffd5lEo
   8:     0x7fab44b5ef41 - trans::type_of::in_memory_type_of::hd518d125e463ffd5lEo
   9:     0x7fab44c61137 - trans::foreign::foreign_signature::h4618e8fc5486898feOB
  10:     0x7fab44c60603 - trans::foreign::foreign_types_for_fn_ty::hbb4f8804cec19fffKPB
  11:     0x7fab44c15e2f - trans::foreign::register_rust_fn_with_foreign_abi::hff88e81da38aeb0f6gB
  12:     0x7fab44b1e905 - trans::base::get_item_val::hfbaf01eba019b69eVnu
  13:     0x7fab44b1bb50 - trans::base::trans_item::h1506a2e4228c48caCSt
  14:     0x7fab44c1859c - trans::base::trans_crate::h6ca4511310a24dc9fPu
  15:     0x7fab45af55c3 - driver::phase_4_translate_to_llvm::h44ad816874743241kOa
  16:     0x7fab45ad11b3 - driver::compile_input::h3bad48bfc23f6006Rba
  17:     0x7fab45b88b02 - run_compiler::haa99afb1c99d7db1x2b
  18:     0x7fab45b8694c - thunk::F.Invoke&lt;A, R&gt;::invoke::h10898031602178947258
  19:     0x7fab45b859d0 - rt::unwind::try::try_fn::h4687345873392121579
  20:     0x7fab45558fc8 - rust_try_inner
  21:     0x7fab45558fb5 - rust_try
  22:     0x7fab45b85e76 - thunk::F.Invoke&lt;A, R&gt;::invoke::h18058446263424162958
  23:     0x7fab454d69f5 - sys::thread::thread_start::h8ed6b7636995fe24B1G
  24:     0x7fab3f39e373 - start_thread
  25:     0x7fab450a027c - __clone
  26:                0x0 - &lt;unknown&gt;
</code></pre></div>