<p dir="auto">The type error makes this segfault:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="use std;
import std::option::*;

fn main() {
  let t[int] x = none;
  x = 5;
}"><pre class="notranslate"><code class="notranslate">use std;
import std::option::*;

fn main() {
  let t[int] x = none;
  x = 5;
}
</code></pre></div>
<p dir="auto">Looks like stack overflow. The interesting part of the backtrace:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1856361" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1019" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1019/hovercard" href="https://github.com/rust-lang/rust/issues/1019">#1019</a> 0x080df952 in middle::ty::fold_ty ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1859804" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1020" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1020/hovercard" href="https://github.com/rust-lang/rust/issues/1020">#1020</a> 0x080f985f in middle::ty::unify::fixup_vars::subst_vars ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1864274" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1021" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1021/hovercard" href="https://github.com/rust-lang/rust/issues/1021">#1021</a> 0x0827bc13 in middle::ty::unify::fixup_vars::subst_vars::thunk3323 ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1867668" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1022" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1022/hovercard" href="https://github.com/rust-lang/rust/issues/1022">#1022</a> 0x080e3e7f in middle::ty::fold_ty ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1875255" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1023" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1023/hovercard" href="https://github.com/rust-lang/rust/issues/1023">#1023</a> 0x080df952 in middle::ty::fold_ty ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1875336" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1024" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1024/hovercard" href="https://github.com/rust-lang/rust/pull/1024">#1024</a> 0x080f985f in middle::ty::unify::fixup_vars::subst_vars ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1883538" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1025" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1025/hovercard" href="https://github.com/rust-lang/rust/pull/1025">#1025</a> 0x0827bc13 in middle::ty::unify::fixup_vars::subst_vars::thunk3323 ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1883798" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1026" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1026/hovercard" href="https://github.com/rust-lang/rust/pull/1026">#1026</a> 0x080e3e7f in middle::ty::fold_ty ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1884100" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1027" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1027/hovercard" href="https://github.com/rust-lang/rust/issues/1027">#1027</a> 0x080df952 in middle::ty::fold_ty ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1884241" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1028" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1028/hovercard" href="https://github.com/rust-lang/rust/issues/1028">#1028</a> 0x080f985f in middle::ty::unify::fixup_vars::subst_vars ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1884398" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1029" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1029/hovercard" href="https://github.com/rust-lang/rust/issues/1029">#1029</a> 0x0827be33 in middle::ty::unify::fixup_vars::thunk3333 ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1885556" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1030" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1030/hovercard" href="https://github.com/rust-lang/rust/pull/1030">#1030</a> 0x080e3e7f in middle::ty::fold_ty ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1889850" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1031" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1031/hovercard" href="https://github.com/rust-lang/rust/pull/1031">#1031</a> 0x080f9bb7 in middle::ty::unify::fixup_vars ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1890995" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1032" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1032/hovercard" href="https://github.com/rust-lang/rust/pull/1032">#1032</a> 0x08137e5a in middle::typeck::demand::full ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1893702" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1033" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1033/hovercard" href="https://github.com/rust-lang/rust/pull/1033">#1033</a> 0x0814097a in middle::typeck::check_expr ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1893733" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1034" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1034/hovercard" href="https://github.com/rust-lang/rust/issues/1034">#1034</a> 0x08145d44 in middle::typeck::check_expr ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1894235" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1035" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1035/hovercard" href="https://github.com/rust-lang/rust/issues/1035">#1035</a> 0x0813fdca in middle::typeck::check_expr::check_then_else ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1894523" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1036" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1036/hovercard" href="https://github.com/rust-lang/rust/pull/1036">#1036</a> 0x08145e0f in middle::typeck::check_expr ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1896994" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1037" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1037/hovercard" href="https://github.com/rust-lang/rust/issues/1037">#1037</a> 0x081530aa in middle::typeck::check_block ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1897189" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1038" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1038/hovercard" href="https://github.com/rust-lang/rust/issues/1038">#1038</a> 0x08146df7 in middle::typeck::check_expr ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1920946" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1039" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1039/hovercard" href="https://github.com/rust-lang/rust/pull/1039">#1039</a> 0x081530aa in middle::typeck::check_block ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1924226" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1040" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1040/hovercard" href="https://github.com/rust-lang/rust/pull/1040">#1040</a> 0x08146df7 in middle::typeck::check_expr ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1928574" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1041" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1041/hovercard" href="https://github.com/rust-lang/rust/pull/1041">#1041</a> 0x081530aa in middle::typeck::check_block ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1928770" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1042" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1042/hovercard" href="https://github.com/rust-lang/rust/issues/1042">#1042</a> 0x0813f85a in middle::typeck::check_expr::check_for_or_for_each ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1931135" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1043" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1043/hovercard" href="https://github.com/rust-lang/rust/issues/1043">#1043</a> 0x08146170 in middle::typeck::check_expr ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1936375" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1044" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1044/hovercard" href="https://github.com/rust-lang/rust/pull/1044">#1044</a> 0x08152ee7 in middle::typeck::check_block ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1936513" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1045" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1045/hovercard" href="https://github.com/rust-lang/rust/pull/1045">#1045</a> 0x08154ee0 in middle::typeck::check_fn ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1938635" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1046" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1046/hovercard" href="https://github.com/rust-lang/rust/issues/1046">#1046</a> 0x08156bda in middle::typeck::check_item ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1958447" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1047" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/1047/hovercard" href="https://github.com/rust-lang/rust/pull/1047">#1047</a> 0x0829730e in middle::typeck::check_crate::thunk5452 ()<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1979621" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1048" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1048/hovercard" href="https://github.com/rust-lang/rust/issues/1048">#1048</a> 0x080fce01 in middle::walk::walk_item ()</p>
<p dir="auto">We can infinite loop if we try to unify e.g. T with option[T]. Fixing this requires implementing the occurs check. Off the top of my head, I can't think of any cases in which we'd actually trip this, but it's theoretically possible.</p>
<hr>
<p dir="auto">Tim thinks this may also be the cause of segfaulting on infinitely interior tags:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tag t1 {
    a(int);
    b(@t1);
}"><pre class="notranslate"><code class="notranslate">tag t1 {
    a(int);
    b(@t1);
}
</code></pre></div>