<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait Hack: std::ops::Add&lt;Self, Output = Self&gt; + Copy {}
fn takes_hack(x: &amp;Hack&lt;Output=i32&gt;) {}```
(which can't work of course)

Gives:
thread 'rustc' panicked at 'assertion failed: !ty.needs_infer()', ../src/librustc_typeck/lib.rs:152
on playpen's nightly and on an older nightly:
   1:     0x7f2a73cac30e - sys::backtrace::write::h1e294cdf8b83f011srs
   2:     0x7f2a73cb44d4 - panicking::on_panic::h759b2622c5bddde1mdx
   3:     0x7f2a73c76ade - rt::unwind::begin_unwind_inner::hdb2ee52cd09f11c10Sw
   4:     0x7f2a73415651 - rt::unwind::begin_unwind::h16407102452406535252
   5:     0x7f2a73519747 - collect::convert_item::hee80771e2831a06bVHx
   6:     0x7f2a735164c7 - collect::collect_item_types::hb25670e75e1ace20iPw
   7:     0x7f2a735636c9 - check_crate::h699f9ca48d981e0dRWC
   8:     0x7f2a74211cc9 - driver::phase_3_run_analysis_passes::closure.15891
   9:     0x7f2a7421060b - middle::ty::ctxt&lt;'tcx&gt;::create_and_enter::h14877326799551551326
  10:     0x7f2a7420b5b1 - driver::phase_3_run_analysis_passes::h13027946853248993312
  11:     0x7f2a741ea80c - driver::compile_input::h1bb41626855952a5Tba
  12:     0x7f2a742d0e83 - run_compiler::hed8febc643a5bd02A7b
  13:     0x7f2a742ce85e - boxed::F.FnBox&lt;A&gt;::call_box::h3262743521461286850
  14:     0x7f2a742ce0a9 - rt::unwind::try::try_fn::h13012207966773460524
  15:     0x7f2a73d2f9d8 - rust_try_inner
  16:     0x7f2a73d2f9c5 - rust_try
  17:     0x7f2a73c9f647 - rt::unwind::try::inner_try::hcf9d4b2ce436da47TOw
  18:     0x7f2a742ce2bb - boxed::F.FnBox&lt;A&gt;::call_box::h5485760352730305604
  19:     0x7f2a73cb3131 - sys::thread::Thread::new::thread_start::h6bca3390d26c61e4GYv"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">Hack</span><span class="pl-kos">:</span> std<span class="pl-kos">::</span>ops<span class="pl-kos">::</span><span class="pl-smi">Add</span><span class="pl-kos">&lt;</span><span class="pl-smi">Self</span><span class="pl-kos">,</span> <span class="pl-smi">Output</span> = <span class="pl-smi">Self</span><span class="pl-kos">&gt;</span> + <span class="pl-smi">Copy</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">takes_hack</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Hack</span><span class="pl-kos">&lt;</span><span class="pl-smi">Output</span>=<span class="pl-smi">i32</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>```
<span class="pl-kos">(</span>which can<span class="pl-c1">'</span>t work of course<span class="pl-kos">)</span>

<span class="pl-v">Gives</span><span class="pl-kos">:</span>
thread <span class="pl-c1">'</span>rustc<span class="pl-c1">'</span> panicked at <span class="pl-c1">'</span>assertion failed<span class="pl-kos">:</span> !ty<span class="pl-kos">.</span><span class="pl-en">needs_infer</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-c1">'</span><span class="pl-kos">,</span> ../src/librustc_typeck/lib<span class="pl-kos">.</span><span class="pl-c1">rs</span><span class="pl-kos">:</span><span class="pl-c1">152</span>
on playpen<span class="pl-c1">'</span>s nightly and on an older nightly<span class="pl-kos">:</span>
   <span class="pl-c1">1</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73cac30e</span> - sys<span class="pl-kos">::</span>backtrace<span class="pl-kos">::</span>write<span class="pl-kos">::</span>h1e294cdf8b83f011srs
   <span class="pl-c1">2</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73cb44d4</span> - panicking<span class="pl-kos">::</span>on_panic<span class="pl-kos">::</span>h759b2622c5bddde1mdx
   <span class="pl-c1">3</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73c76ade</span> - rt<span class="pl-kos">::</span>unwind<span class="pl-kos">::</span>begin_unwind_inner<span class="pl-kos">::</span>hdb2ee52cd09f11c10Sw
   <span class="pl-c1">4</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73415651</span> - rt<span class="pl-kos">::</span>unwind<span class="pl-kos">::</span>begin_unwind<span class="pl-kos">::</span>h16407102452406535252
   <span class="pl-c1">5</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73519747</span> - collect<span class="pl-kos">::</span>convert_item<span class="pl-kos">::</span>hee80771e2831a06bVHx
   <span class="pl-c1">6</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a735164c7</span> - collect<span class="pl-kos">::</span>collect_item_types<span class="pl-kos">::</span>hb25670e75e1ace20iPw
   <span class="pl-c1">7</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a735636c9</span> - check_crate<span class="pl-kos">::</span>h699f9ca48d981e0dRWC
   <span class="pl-c1">8</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a74211cc9</span> - driver<span class="pl-kos">::</span>phase_3_run_analysis_passes<span class="pl-kos">::</span>closure<span class="pl-kos">.</span><span class="pl-c1">15891</span>
   <span class="pl-c1">9</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a7421060b</span> - middle<span class="pl-kos">::</span>ty<span class="pl-kos">::</span>ctxt&lt;<span class="pl-c1">'</span>tcx&gt;<span class="pl-kos">::</span>create_and_enter<span class="pl-kos">::</span><span class="pl-smi">h14877326799551551326</span>
  <span class="pl-c1">10</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a7420b5b1</span> - driver<span class="pl-kos">::</span>phase_3_run_analysis_passes<span class="pl-kos">::</span>h13027946853248993312
  <span class="pl-c1">11</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a741ea80c</span> - driver<span class="pl-kos">::</span>compile_input<span class="pl-kos">::</span>h1bb41626855952a5Tba
  <span class="pl-c1">12</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a742d0e83</span> - run_compiler<span class="pl-kos">::</span>hed8febc643a5bd02A7b
  <span class="pl-c1">13</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a742ce85e</span> - boxed<span class="pl-kos">::</span><span class="pl-v">F</span><span class="pl-kos">.</span><span class="pl-c1">FnBox</span>&lt;<span class="pl-v">A</span>&gt;<span class="pl-kos">::</span>call_box<span class="pl-kos">::</span>h3262743521461286850
  <span class="pl-c1">14</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a742ce0a9</span> - rt<span class="pl-kos">::</span>unwind<span class="pl-kos">::</span>try<span class="pl-kos">::</span>try_fn<span class="pl-kos">::</span>h13012207966773460524
  <span class="pl-c1">15</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73d2f9d8</span> - rust_try_inner
  <span class="pl-c1">16</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73d2f9c5</span> - rust_try
  <span class="pl-c1">17</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73c9f647</span> - rt<span class="pl-kos">::</span>unwind<span class="pl-kos">::</span>try<span class="pl-kos">::</span>inner_try<span class="pl-kos">::</span>hcf9d4b2ce436da47TOw
  <span class="pl-c1">18</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a742ce2bb</span> - boxed<span class="pl-kos">::</span><span class="pl-v">F</span><span class="pl-kos">.</span><span class="pl-c1">FnBox</span>&lt;<span class="pl-v">A</span>&gt;<span class="pl-kos">::</span>call_box<span class="pl-kos">::</span>h5485760352730305604
  <span class="pl-c1">19</span><span class="pl-kos">:</span>     <span class="pl-c1">0x7f2a73cb3131</span> - sys<span class="pl-kos">::</span>thread<span class="pl-kos">::</span><span class="pl-smi">Thread</span><span class="pl-kos">::</span>new<span class="pl-kos">::</span>thread_start<span class="pl-kos">::</span><span class="pl-smi">h6bca3390d26c61e4GYv</span></pre></div>
<p dir="auto">Code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::ops::Add;

pub trait State: Add&lt;Output=Self&gt; {
    fn new() -&gt; State&lt;Output=Self&gt;;
}"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>ops<span class="pl-kos">::</span><span class="pl-v">Add</span><span class="pl-kos">;</span>

<span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">State</span><span class="pl-kos">:</span> <span class="pl-smi">Add</span><span class="pl-kos">&lt;</span><span class="pl-smi">Output</span>=<span class="pl-smi">Self</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">State</span><span class="pl-kos">&lt;</span><span class="pl-smi">Output</span>=<span class="pl-smi">Self</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'rustc' panicked at 'assertion failed: !ty.needs_infer()', src/librustc_typeck/lib.rs:152"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'assertion failed: !ty.needs_infer()', src/librustc_typeck/lib.rs:152
</code></pre></div>
<p dir="auto">Backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stack backtrace:
   1:     0x7f363e5e966e - sys::backtrace::write::ha67a6a2049d22fadIvs
   2:     0x7f363e5f1d55 - panicking::on_panic::hfa4bf0215983f759lzx
   3:     0x7f363e5b294e - rt::unwind::begin_unwind_inner::ha1b5da93bdf7e8ffC0w
   4:     0x7f363dd48d91 - rt::unwind::begin_unwind::h12043835423437895913
   5:     0x7f363de580e5 - collect::convert_method::h4805f8e025461365dEx
   6:     0x7f363de466dd - collect::convert_item::h6b6cad92074d9a24CSx
   7:     0x7f363de41407 - collect::collect_item_types::hd02205bf6b76e82bS0w
   8:     0x7f363de8df39 - check_crate::h341139d405597625laD
   9:     0x7f363eb4e199 - driver::phase_3_run_analysis_passes::closure.16542
  10:     0x7f363eb4cab1 - middle::ty::ctxt&lt;'tcx&gt;::create_and_enter::h9578579149294230291
  11:     0x7f363eb47991 - driver::phase_3_run_analysis_passes::h8415522514568150077
  12:     0x7f363eb2ba90 - driver::compile_input::h52c7dafd49963360Tba
  13:     0x7f363ec11a63 - run_compiler::h473c62e00f865fa9A7b
  14:     0x7f363ec0f4de - boxed::F.FnBox&lt;A&gt;::call_box::h10713159552398332324
  15:     0x7f363ec0ee09 - rt::unwind::try::try_fn::h16887904248528792425
  16:     0x7f363e5f184d - __rust_try
  17:     0x7f363e5dc8f7 - rt::unwind::try::inner_try::hafffff77ddacfa5fvWw
  18:     0x7f363ec0f028 - boxed::F.FnBox&lt;A&gt;::call_box::h5417278073590676257
  19:     0x7f363e5f0991 - sys::thread::Thread::new::thread_start::h29dca2a2cf2294b535v
  20:     0x7f3638e904a3 - start_thread
  21:     0x7f363e24e13c - clone
  22:                0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">stack backtrace:
   1:     0x7f363e5e966e - sys::backtrace::write::ha67a6a2049d22fadIvs
   2:     0x7f363e5f1d55 - panicking::on_panic::hfa4bf0215983f759lzx
   3:     0x7f363e5b294e - rt::unwind::begin_unwind_inner::ha1b5da93bdf7e8ffC0w
   4:     0x7f363dd48d91 - rt::unwind::begin_unwind::h12043835423437895913
   5:     0x7f363de580e5 - collect::convert_method::h4805f8e025461365dEx
   6:     0x7f363de466dd - collect::convert_item::h6b6cad92074d9a24CSx
   7:     0x7f363de41407 - collect::collect_item_types::hd02205bf6b76e82bS0w
   8:     0x7f363de8df39 - check_crate::h341139d405597625laD
   9:     0x7f363eb4e199 - driver::phase_3_run_analysis_passes::closure.16542
  10:     0x7f363eb4cab1 - middle::ty::ctxt&lt;'tcx&gt;::create_and_enter::h9578579149294230291
  11:     0x7f363eb47991 - driver::phase_3_run_analysis_passes::h8415522514568150077
  12:     0x7f363eb2ba90 - driver::compile_input::h52c7dafd49963360Tba
  13:     0x7f363ec11a63 - run_compiler::h473c62e00f865fa9A7b
  14:     0x7f363ec0f4de - boxed::F.FnBox&lt;A&gt;::call_box::h10713159552398332324
  15:     0x7f363ec0ee09 - rt::unwind::try::try_fn::h16887904248528792425
  16:     0x7f363e5f184d - __rust_try
  17:     0x7f363e5dc8f7 - rt::unwind::try::inner_try::hafffff77ddacfa5fvWw
  18:     0x7f363ec0f028 - boxed::F.FnBox&lt;A&gt;::call_box::h5417278073590676257
  19:     0x7f363e5f0991 - sys::thread::Thread::new::thread_start::h29dca2a2cf2294b535v
  20:     0x7f3638e904a3 - start_thread
  21:     0x7f363e24e13c - clone
  22:                0x0 - &lt;unknown&gt;
</code></pre></div>
<p dir="auto">Version: 1.3.0</p>