<p dir="auto">A simple example involving a type alias, a nested type, and <code class="notranslate">Fn</code> causes an ICE.</p>
<p dir="auto">I tried this code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct C&lt;A&gt; { a: A }

type T&lt;A, B&gt; = C&lt;Fn(A) -&gt; B&gt;;

fn id&lt;A, B&gt;(t: T&lt;&amp;A, B&gt;) -&gt; T&lt;&amp;A, B&gt; { t }"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">C</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">A</span> <span class="pl-kos">}</span>

<span class="pl-k">type</span> <span class="pl-smi">T</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span><span class="pl-kos">&gt;</span> = <span class="pl-smi">C</span><span class="pl-kos">&lt;</span><span class="pl-smi">Fn</span><span class="pl-kos">(</span><span class="pl-smi">A</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">B</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>

<span class="pl-k">fn</span> <span class="pl-en">id</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">:</span> <span class="pl-smi">T</span><span class="pl-kos">&lt;</span><span class="pl-c1">&amp;</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">T</span><span class="pl-kos">&lt;</span><span class="pl-c1">&amp;</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> t <span class="pl-kos">}</span></pre></div>
<p dir="auto">I expected to see either no error, or at most an error about lifetime elision.</p>
<p dir="auto">Instead, when compiled with <code class="notranslate">rustc --crate-type=lib</code> I get an ICE. The effect persists when <code class="notranslate">C</code> is replaced by <code class="notranslate">Box</code>, but disappears if <code class="notranslate">Fn</code> is replaced by another two-parameter type.</p>
<p dir="auto">The ICE:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: unexpected panic
thread 'rustc' panicked at 
'assertion failed: !predicates.has_escaping_regions()',
/build/rust/src/rustc-1.0.0/src/librustc_typeck/check/mod.rs:1698"><pre class="notranslate"><code class="notranslate">error: internal compiler error: unexpected panic
thread 'rustc' panicked at 
'assertion failed: !predicates.has_escaping_regions()',
/build/rust/src/rustc-1.0.0/src/librustc_typeck/check/mod.rs:1698
</code></pre></div>
<p dir="auto">The backtrace output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stack backtrace:
   1:     0x7f892d092189 - sys::backtrace::write::h85e36588f6ec519ed4r
   2:     0x7f892d099e96 - &lt;unknown&gt;
   3:     0x7f892d05d1a2 - rt::unwind::begin_unwind_inner::h58d8677c31c147e6t6v
   4:     0x7f892be6090e - &lt;unknown&gt;
   5:     0x7f892bead693 - &lt;unknown&gt;
   6:     0x7f892bee43d1 - check::wf::BoundsChecker&lt;'cx, 'tcx&gt;.TypeFolder&lt;'tcx&gt;::fold_ty::hf49f58e50ffe027105k
   7:     0x7f892bee619b - &lt;unknown&gt;
   8:     0x7f892bee46c8 - check::wf::BoundsChecker&lt;'cx, 'tcx&gt;.TypeFolder&lt;'tcx&gt;::fold_ty::hf49f58e50ffe027105k
   9:     0x7f892bedb8d7 - &lt;unknown&gt;
  10:     0x7f892bfc628d - &lt;unknown&gt;
  11:     0x7f892bfc16e0 - check_crate::h5570390160d0735dXcC
  12:     0x7f892d5cca18 - driver::phase_3_run_analysis_passes::h8472d32b1f7cb2d6nGa
  13:     0x7f892d5adb15 - driver::compile_input::hee759950e4b56686Qba
  14:     0x7f892d66efe1 - run_compiler::h57ce534eedce4c58z4b
  15:     0x7f892d66cc32 - &lt;unknown&gt;
  16:     0x7f892d66c169 - &lt;unknown&gt;
  17:     0x7f892d103b28 - &lt;unknown&gt;
  18:     0x7f892d103b15 - rust_try
  19:     0x7f892d66c418 - &lt;unknown&gt;
  20:     0x7f892d098d81 - &lt;unknown&gt;
  21:     0x7f8927b22373 - start_thread
  22:     0x7f892ccf227c - clone
  23:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">stack backtrace:
   1:     0x7f892d092189 - sys::backtrace::write::h85e36588f6ec519ed4r
   2:     0x7f892d099e96 - &lt;unknown&gt;
   3:     0x7f892d05d1a2 - rt::unwind::begin_unwind_inner::h58d8677c31c147e6t6v
   4:     0x7f892be6090e - &lt;unknown&gt;
   5:     0x7f892bead693 - &lt;unknown&gt;
   6:     0x7f892bee43d1 - check::wf::BoundsChecker&lt;'cx, 'tcx&gt;.TypeFolder&lt;'tcx&gt;::fold_ty::hf49f58e50ffe027105k
   7:     0x7f892bee619b - &lt;unknown&gt;
   8:     0x7f892bee46c8 - check::wf::BoundsChecker&lt;'cx, 'tcx&gt;.TypeFolder&lt;'tcx&gt;::fold_ty::hf49f58e50ffe027105k
   9:     0x7f892bedb8d7 - &lt;unknown&gt;
  10:     0x7f892bfc628d - &lt;unknown&gt;
  11:     0x7f892bfc16e0 - check_crate::h5570390160d0735dXcC
  12:     0x7f892d5cca18 - driver::phase_3_run_analysis_passes::h8472d32b1f7cb2d6nGa
  13:     0x7f892d5adb15 - driver::compile_input::hee759950e4b56686Qba
  14:     0x7f892d66efe1 - run_compiler::h57ce534eedce4c58z4b
  15:     0x7f892d66cc32 - &lt;unknown&gt;
  16:     0x7f892d66c169 - &lt;unknown&gt;
  17:     0x7f892d103b28 - &lt;unknown&gt;
  18:     0x7f892d103b15 - rust_try
  19:     0x7f892d66c418 - &lt;unknown&gt;
  20:     0x7f892d098d81 - &lt;unknown&gt;
  21:     0x7f8927b22373 - start_thread
  22:     0x7f892ccf227c - clone
  23:                0x0 - &lt;unknown&gt;
</code></pre></div>
<p dir="auto">The output of <code class="notranslate">rustc --version --verbose</code> is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.0.0-beta.5 (built 2015-05-16)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-05-16
host: x86_64-unknown-linux-gnu
release: 1.0.0-beta.5"><pre class="notranslate"><code class="notranslate">rustc 1.0.0-beta.5 (built 2015-05-16)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-05-16
host: x86_64-unknown-linux-gnu
release: 1.0.0-beta.5
</code></pre></div>
<p dir="auto">Compiler panic. Found an ealier issue in the same file that had been closed because the problem had gone away in later compiles. This is the stable 1.1 though.</p>
<p dir="auto"><b>Version info</b><br>
rustc 1.1.0 (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/35ceea3997c79a3b7562e89b462ab76af5b86b22/hovercard" href="https://github.com/rust-lang/rust/commit/35ceea3997c79a3b7562e89b462ab76af5b86b22"><tt>35ceea3</tt></a> 2015-06-19)<br>
binary: rustc<br>
commit-hash: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/35ceea3997c79a3b7562e89b462ab76af5b86b22/hovercard" href="https://github.com/rust-lang/rust/commit/35ceea3997c79a3b7562e89b462ab76af5b86b22"><tt>35ceea3</tt></a><br>
commit-date: 2015-06-19<br>
host: x86_64-pc-windows-gnu<br>
release: 1.1.0</p>
<p dir="auto"><b>RUST_BACKTRACE=1 rustc --verbose src/main.rs</b><br>
error: internal compiler error: unexpected panic<br>
note: the compiler unexpectedly panicked. this is a bug.<br>
note: we would appreciate a bug report: <a href="https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports">https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports</a><br>
note: run with <code class="notranslate">RUST_BACKTRACE=1</code> for a backtrace<br>
thread 'rustc' panicked at 'assertion failed: !self.has_escaping_regions()', C:/bot/slave/stable-dist-rustc-win-gnu-64/build/src/librustc\middle\ty.rs:2123</p>
<p dir="auto">stack backtrace:<br>
1:         0x6f138a02 - sys::backtrace::write::hb142593d131303b10fs<br>
2:         0x6f141e76 - rt::unwind::register::h2f2891f465b0e536sNv<br>
3:         0x6f1053c0 - rt::unwind::begin_unwind_inner::he5d025d7f655ecaaCKv<br>
4:         0x6d08989e - middle::astencode::rbml..Doc&lt;'a&gt;.doc_decoder_helpers::opt_child::hd6aba4d7b00f0fc9UKb<br>
5:         0x6d1c0773 - middle::traits::fulfill::FulfillmentContext&lt;'tcx&gt;::register_builtin_bound::h1fba927ecfad50a9DEO<br>
6:         0x6a93c978 - check::FnCtxt&lt;'a, 'tcx&gt;.mc..Typer&lt;'tcx&gt;::is_method_call::hb206e83d494db5a0Akn<br>
7:         0x6a948ac8 - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::he778b71de0699925wAo<br>
8:         0x6a95effc - check::CheckItemBodiesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h49b5aaa3aec9c80dWrn<br>
9:         0x6a95d1df - check::CheckItemBodiesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h49b5aaa3aec9c80dWrn<br>
10:         0x6aa187ab - check_crate::hf98f1f239eb0b1afsJC<br>
11:         0x6aa11f75 - check_crate::hf98f1f239eb0b1afsJC<br>
12:         0x6701f3dd - driver::phase_3_run_analysis_passes::h5d9dbc988e0fcdbatGa<br>
13:         0x67002b40 - driver::compile_input::h66ba80b489f2ef28Qba<br>
14:         0x670b5913 - run_compiler::hf1308c7d75cfa1a775b<br>
15:         0x670b349f - run::h99d8d2bce2d42189N5b<br>
16:         0x670b2a59 - run::h99d8d2bce2d42189N5b<br>
17:         0x6f17b5bc - rust_try<br>
18:         0x6f17b599 - rust_try<br>
19:         0x670b2cd5 - run::h99d8d2bce2d42189N5b<br>
20:         0x6f140134 - sys::process::Command::cwd::hecbd2393e1ca7c52luu<br>
21:         0x776659cd - BaseThreadInitThunk</p>