<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
    let foo: &amp;mut [u8] = &amp;mut [1,2,3];
    foo as *mut [u8] as *mut u8;
}"><pre class="notranslate"><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> foo<span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span> = <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    foo <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span> <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">mut</span> <span class="pl-smi">u8</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: translating unsupported cast: *mut [u8] (cast_other) -&gt; *mut u8 (cast_pointer)
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box&lt;Any&gt;', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:175"><pre class="notranslate"><code class="notranslate">error: internal compiler error: translating unsupported cast: *mut [u8] (cast_other) -&gt; *mut u8 (cast_pointer)
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box&lt;Any&gt;', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:175
</code></pre></div>
<p dir="auto">The following code ICEs:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
let r : &amp;[int] = &amp;[1,2,3];
let _ = r as *const [int] as uint;
}"><pre class="notranslate"><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> r <span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-smi">int</span><span class="pl-kos">]</span> = <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> _ = r <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">const</span> <span class="pl-kos">[</span><span class="pl-smi">int</span><span class="pl-kos">]</span> <span class="pl-k">as</span> <span class="pl-smi">uint</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: translating unsupported cast: *const [int] (cast_other) -&gt; uint (cast_integral)
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box&lt;Any&gt;', /tmp/tmp.AJuZnZc9G6/rust/src/libsyntax/ast_util.rs:776

stack backtrace:
   1:     0x7fd831534e20 - rt::backtrace::imp::write::h05ad71e0d8d53545YFq
   2:     0x7fd831537fe0 - failure::on_fail::h67318170e271381eq1q
   3:     0x7fd831d0ef40 - unwind::begin_unwind_inner::hab98eb958c8dd037MTd
   4:     0x7fd830019c20 - unwind::begin_unwind::h6101647644969584620
   5:     0x7fd83001a3c0 - diagnostic::Handler::bug::h73bed1cade32a05dYID
   6:     0x7fd832101800 - driver::session::Session::bug::haf0a22dbefd7a44bSmv
   7:     0x7fd8325467d0 - middle::trans::expr::trans_imm_cast::h3be503504a2cb4d6iY2
   8:     0x7fd832539140 - middle::trans::expr::trans_unadjusted::hd291a28db4ab1b64i50
   9:     0x7fd8324f6380 - middle::trans::expr::trans::h4aa7a0f1f6a515f12o0
  10:     0x7fd83259d640 - middle::trans::_match::store_local::h95ac038bd6a8824cjRf
  11:     0x7fd8324f4310 - middle::trans::base::init_local::hcaa97d53d8042b21zyb
  12:     0x7fd8324f3810 - middle::trans::controlflow::trans_stmt::h754badf284040952fjW
  13:     0x7fd8324f51b0 - middle::trans::controlflow::trans_block::hd9fdbeb4ba696bd2boW
  14:     0x7fd8325a6520 - middle::trans::base::trans_closure::h201746f506a92a56lpc
  15:     0x7fd8324e4b50 - middle::trans::base::trans_fn::hfc81a7de00fc2ea6yAc
  16:     0x7fd8324e01d0 - middle::trans::base::trans_item::h0854978c1c605151HTc
  17:     0x7fd8325b2910 - middle::trans::base::trans_crate::haa777e4646f5d49aBRd
  18:     0x7fd8329f3c80 - driver::driver::phase_4_translate_to_llvm::hee038ef8fdb7099bjOu
  19:     0x7fd8329eb130 - driver::driver::compile_input::h411f5de1517db61bIpu
  20:     0x7fd832a7f680 - driver::run_compiler::h918ca986269540e0iay
  21:     0x7fd832a7f560 - driver::main_args::closure.148406
  22:     0x7fd83212f540 - task::TaskBuilder&lt;S&gt;::try_future::closure.100321
  23:     0x7fd83212f330 - task::TaskBuilder&lt;S&gt;::spawn_internal::closure.100292
  24:     0x7fd8333eb720 - task::spawn_opts::closure.8416
  25:     0x7fd831d6f930 - rust_try_inner
  26:     0x7fd831d6f920 - rust_try
  27:     0x7fd831d0c520 - unwind::try::ha98ecfc6c2b84277uId
  28:     0x7fd831d0c380 - task::Task::run::hc9ce4f8671722f9bfYc
  29:     0x7fd8333eb490 - task::spawn_opts::closure.8356
  30:     0x7fd831d0df70 - thread::thread_start::h605925f5652c970frid
  31:     0x7fd830ff6dc0 - start_thread
  32:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">error: internal compiler error: translating unsupported cast: *const [int] (cast_other) -&gt; uint (cast_integral)
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box&lt;Any&gt;', /tmp/tmp.AJuZnZc9G6/rust/src/libsyntax/ast_util.rs:776

stack backtrace:
   1:     0x7fd831534e20 - rt::backtrace::imp::write::h05ad71e0d8d53545YFq
   2:     0x7fd831537fe0 - failure::on_fail::h67318170e271381eq1q
   3:     0x7fd831d0ef40 - unwind::begin_unwind_inner::hab98eb958c8dd037MTd
   4:     0x7fd830019c20 - unwind::begin_unwind::h6101647644969584620
   5:     0x7fd83001a3c0 - diagnostic::Handler::bug::h73bed1cade32a05dYID
   6:     0x7fd832101800 - driver::session::Session::bug::haf0a22dbefd7a44bSmv
   7:     0x7fd8325467d0 - middle::trans::expr::trans_imm_cast::h3be503504a2cb4d6iY2
   8:     0x7fd832539140 - middle::trans::expr::trans_unadjusted::hd291a28db4ab1b64i50
   9:     0x7fd8324f6380 - middle::trans::expr::trans::h4aa7a0f1f6a515f12o0
  10:     0x7fd83259d640 - middle::trans::_match::store_local::h95ac038bd6a8824cjRf
  11:     0x7fd8324f4310 - middle::trans::base::init_local::hcaa97d53d8042b21zyb
  12:     0x7fd8324f3810 - middle::trans::controlflow::trans_stmt::h754badf284040952fjW
  13:     0x7fd8324f51b0 - middle::trans::controlflow::trans_block::hd9fdbeb4ba696bd2boW
  14:     0x7fd8325a6520 - middle::trans::base::trans_closure::h201746f506a92a56lpc
  15:     0x7fd8324e4b50 - middle::trans::base::trans_fn::hfc81a7de00fc2ea6yAc
  16:     0x7fd8324e01d0 - middle::trans::base::trans_item::h0854978c1c605151HTc
  17:     0x7fd8325b2910 - middle::trans::base::trans_crate::haa777e4646f5d49aBRd
  18:     0x7fd8329f3c80 - driver::driver::phase_4_translate_to_llvm::hee038ef8fdb7099bjOu
  19:     0x7fd8329eb130 - driver::driver::compile_input::h411f5de1517db61bIpu
  20:     0x7fd832a7f680 - driver::run_compiler::h918ca986269540e0iay
  21:     0x7fd832a7f560 - driver::main_args::closure.148406
  22:     0x7fd83212f540 - task::TaskBuilder&lt;S&gt;::try_future::closure.100321
  23:     0x7fd83212f330 - task::TaskBuilder&lt;S&gt;::spawn_internal::closure.100292
  24:     0x7fd8333eb720 - task::spawn_opts::closure.8416
  25:     0x7fd831d6f930 - rust_try_inner
  26:     0x7fd831d6f920 - rust_try
  27:     0x7fd831d0c520 - unwind::try::ha98ecfc6c2b84277uId
  28:     0x7fd831d0c380 - task::Task::run::hc9ce4f8671722f9bfYc
  29:     0x7fd8333eb490 - task::spawn_opts::closure.8356
  30:     0x7fd831d0df70 - thread::thread_start::h605925f5652c970frid
  31:     0x7fd830ff6dc0 - start_thread
  32:                0x0 - &lt;unknown&gt;
</code></pre></div>