<p dir="auto">ICE when accessing a non-existent enum variant through a reference.</p>
<p dir="auto">Test case 1 (<code class="notranslate">Bar</code> is a struct, not even an enum):</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn foo&lt;T&gt;(t: &amp;T) {}

struct Bar;

fn main() { 
    foo(&amp;Bar::Baz);
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</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-c1">&amp;</span><span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

<span class="pl-k">struct</span> <span class="pl-smi">Bar</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-en">foo</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-smi">Bar</span><span class="pl-kos">::</span><span class="pl-v">Baz</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Test case 2 (Bar::Baz is a non-existent enum variant):</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn foo&lt;T&gt;(t: &amp;T) {}

enum Bar {
    NotBaz
}

fn main() { 
    foo(&amp;Bar::Baz);
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</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-c1">&amp;</span><span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

<span class="pl-k">enum</span> <span class="pl-smi">Bar</span> <span class="pl-kos">{</span>
    <span class="pl-v">NotBaz</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-en">foo</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-smi">Bar</span><span class="pl-kos">::</span><span class="pl-v">Baz</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">ICE backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: unexpected panic
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 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 12 }, false), last_private: LastMod(AllPublic), depth: 1 }', C:/bot/slave/nightly-dist-rustc-win-64/build/src/librustc\middle\def.rs:81

stack backtrace:
   1:         0x711b8f12 - sys::backtrace::write::hdb51798d383e2c695rs
   2:         0x711c2376 - rt::unwind::register::hef1903092323c9734Yv
   3:         0x71185220 - rt::unwind::begin_unwind_inner::h2fa0652062c22375eWv
   4:         0x71185c27 - rt::unwind::begin_unwind_fmt::h13657eb4ac5da50ekVv
   5:           0xee0c56 - middle::ty::resolve_expr::h51d7abf3a2732b230v6
   6:          0x1026a06 - middle::ty::expr_kind::he8d8b524640e8d6b6x6
   7:          0x10267f9 - middle::ty::expr_is_lval::h9fe5b61c1e6534c03w6
   8:          0x163fff5 - check::UnresolvedTypeAction...std..clone..Clone::clone::hf4c3a245578662abVEp
   9:          0x161ae79 - check::callee::CallResolution&lt;'tcx&gt;.DeferredCallResolution&lt;'tcx&gt;::resolve::he161ac943e0493a8hcm
  10:          0x161884a - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h240f52ba63e8d53aBNo
  11:          0x16173ef - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h240f52ba63e8d53aBNo
  12:          0x166c818 - check::UnresolvedTypeAction...std..clone..Clone::clone::hf4c3a245578662abVEp
  13:          0x162f1e1 - check::GatherLocalsVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h575c0a1a31f9fe703Rn
  14:          0x161525a - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h240f52ba63e8d53aBNo
  15:          0x162abac - check::CheckItemBodiesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h93ccea520f14b38cXEn
  16:          0x1628d8f - check::CheckItemBodiesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h93ccea520f14b38cXEn
  17:          0x16dec1b - check_crate::hc2ca7a846886762c5CC
  18:          0x16d7c29 - check_crate::hc2ca7a846886762c5CC
  19:         0x652e24a2 - driver::phase_3_run_analysis_passes::h6baa270e309301b6tGa
  20:         0x652c2b40 - driver::compile_input::h26af5f3f80d0ca83Qba
  21:         0x65378e23 - run_compiler::h08ad06f8fc43c8db65b
  22:         0x653769af - run::h3d20f7e70be2f675M5b
  23:         0x65375f69 - run::h3d20f7e70be2f675M5b
  24:         0x711f727c - rust_try
  25:         0x711f7259 - rust_try
  26:         0x653761e5 - run::h3d20f7e70be2f675M5b
  27:         0x711c0624 - sys::process2::Command::cwd::h53354db0f20fd45brGu
  28:         0x775a59cd - BaseThreadInitThunk

Could not compile `rust-test`.

To learn more, run the command again with --verbose."><pre class="notranslate"><code class="notranslate">error: internal compiler error: unexpected panic
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 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 12 }, false), last_private: LastMod(AllPublic), depth: 1 }', C:/bot/slave/nightly-dist-rustc-win-64/build/src/librustc\middle\def.rs:81

stack backtrace:
   1:         0x711b8f12 - sys::backtrace::write::hdb51798d383e2c695rs
   2:         0x711c2376 - rt::unwind::register::hef1903092323c9734Yv
   3:         0x71185220 - rt::unwind::begin_unwind_inner::h2fa0652062c22375eWv
   4:         0x71185c27 - rt::unwind::begin_unwind_fmt::h13657eb4ac5da50ekVv
   5:           0xee0c56 - middle::ty::resolve_expr::h51d7abf3a2732b230v6
   6:          0x1026a06 - middle::ty::expr_kind::he8d8b524640e8d6b6x6
   7:          0x10267f9 - middle::ty::expr_is_lval::h9fe5b61c1e6534c03w6
   8:          0x163fff5 - check::UnresolvedTypeAction...std..clone..Clone::clone::hf4c3a245578662abVEp
   9:          0x161ae79 - check::callee::CallResolution&lt;'tcx&gt;.DeferredCallResolution&lt;'tcx&gt;::resolve::he161ac943e0493a8hcm
  10:          0x161884a - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h240f52ba63e8d53aBNo
  11:          0x16173ef - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h240f52ba63e8d53aBNo
  12:          0x166c818 - check::UnresolvedTypeAction...std..clone..Clone::clone::hf4c3a245578662abVEp
  13:          0x162f1e1 - check::GatherLocalsVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h575c0a1a31f9fe703Rn
  14:          0x161525a - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h240f52ba63e8d53aBNo
  15:          0x162abac - check::CheckItemBodiesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h93ccea520f14b38cXEn
  16:          0x1628d8f - check::CheckItemBodiesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::h93ccea520f14b38cXEn
  17:          0x16dec1b - check_crate::hc2ca7a846886762c5CC
  18:          0x16d7c29 - check_crate::hc2ca7a846886762c5CC
  19:         0x652e24a2 - driver::phase_3_run_analysis_passes::h6baa270e309301b6tGa
  20:         0x652c2b40 - driver::compile_input::h26af5f3f80d0ca83Qba
  21:         0x65378e23 - run_compiler::h08ad06f8fc43c8db65b
  22:         0x653769af - run::h3d20f7e70be2f675M5b
  23:         0x65375f69 - run::h3d20f7e70be2f675M5b
  24:         0x711f727c - rust_try
  25:         0x711f7259 - rust_try
  26:         0x653761e5 - run::h3d20f7e70be2f675M5b
  27:         0x711c0624 - sys::process2::Command::cwd::h53354db0f20fd45brGu
  28:         0x775a59cd - BaseThreadInitThunk

Could not compile `rust-test`.

To learn more, run the command again with --verbose.
</code></pre></div>
<h2 dir="auto">Meta</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.1.0-nightly (7bd71637c 2015-05-06) (built 2015-05-06)
binary: rustc
commit-hash: 7bd71637ca40910dbd310813a19abf76db84f8f6
commit-date: 2015-05-06
build-date: 2015-05-06
host: x86_64-pc-windows-gnu
release: 1.1.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 1.1.0-nightly (7bd71637c 2015-05-06) (built 2015-05-06)
binary: rustc
commit-hash: 7bd71637ca40910dbd310813a19abf76db84f8f6
commit-date: 2015-05-06
build-date: 2015-05-06
host: x86_64-pc-windows-gnu
release: 1.1.0-nightly
</code></pre></div>
<p dir="auto">The compiler seems to raise a ICE whenever an enum literal reference that's passed directly as a function parameter is missing or misspelled:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ }

fn use_token(token: &amp;Token) { unimplemented!() }

fn main() {
    // Token::LeftParens is misspelled, should be Token::LeftParen.
    use_token(&amp;Token::LeftParens);
}"><pre class="notranslate"><span class="pl-k">enum</span> <span class="pl-smi">Token</span> <span class="pl-kos">{</span> <span class="pl-v">LeftParen</span><span class="pl-kos">,</span> <span class="pl-v">RightParen</span><span class="pl-kos">,</span> <span class="pl-v">Plus</span><span class="pl-kos">,</span> <span class="pl-v">Minus</span><span class="pl-kos">,</span> <span class="pl-c">/* etc */</span> <span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">use_token</span><span class="pl-kos">(</span><span class="pl-s1">token</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Token</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">unimplemented</span><span class="pl-en">!</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-c">// Token::LeftParens is misspelled, should be Token::LeftParen.</span>
    <span class="pl-en">use_token</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-smi">Token</span><span class="pl-kos">::</span><span class="pl-v">LeftParens</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="thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, true), last_private: LastMod(AllPublic), depth: 1 }', C:/bot/slave/nightly-dist-rustc-win-64/build/src/librustc\middle\def.rs:79

stack backtrace:
   1:         0x71217094 - sys::backtrace::write::h702ba69fda76a133UVA
   2:         0x71231708 - rt::unwind::register::h2807fa6be024d773ZpJ
   3:         0x71183427 - rt::unwind::begin_unwind_inner::h33dce4042bd21f85onJ
   4:         0x71183beb - rt::unwind::begin_unwind_fmt::hae30e0776fdf0958ZlJ
   5:           0xf5ba4a - middle::ty::resolve_expr::h3413f822b132c794uV6
   6:          0x108d876 - middle::ty::expr_kind::h7a4229e8cf2923d94W6
   7:          0x108d589 - middle::ty::expr_is_lval::hee14165bdb90e648xW6
   8:          0x1685988 - check::UnresolvedTypeAction...std..fmt..Debug::fmt::h6fea2f9b6c32405bN8o
   9:          0x1663989 - check::callee::CallResolution&lt;'tcx&gt;.DeferredCallResolution&lt;'tcx&gt;::resolve::h620708a97b262156Qlm
  10:          0x1660e5b - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h3d9369be1c793797zjo
  11:          0x165fad8 - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h3d9369be1c793797zjo
  12:          0x16af2f8 - check::UnresolvedTypeAction...std..fmt..Debug::fmt::h6fea2f9b6c32405bN8o
  13:          0x16751e1 - check::GatherLocalsVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::hccf69f0ad25ab806Xln
  14:          0x165d854 - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h3d9369be1c793797zjo
  15:          0x1672a8c - check::CheckItemTypesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_ty::hb08a5401782be257man
  16:          0x166b304 - check::CheckItemTypesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::hbc63086752858e7d09m
  17:          0x17280d4 - check_crate::h490a1c107c2f6f04hfC
  18:          0x1723821 - check_crate::h490a1c107c2f6f04hfC
  19:         0x652deb3b - driver::phase_3_run_analysis_passes::h95f5e5d96e327896mGa
  20:         0x652c2669 - driver::compile_input::h5f994866bdbf7f9fNba
  21:         0x6538530d - run_compiler::h716ee0dff1e124acG6b
  22:         0x65383253 - run::h15ad65cc2cf082cdm6b
  23:         0x65381e1e - run::h15ad65cc2cf082cdm6b
  24:         0x7125f58c - rust_try
  25:         0x7125f569 - rust_try
  26:         0x65382597 - run::h15ad65cc2cf082cdm6b
  27:         0x71221c32 - sys::tcp::TcpListener::bind::h29247aa3f005ffa1WSE
  28:     0x7ffd672316ad - BaseThreadInitThunk"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, true), last_private: LastMod(AllPublic), depth: 1 }', C:/bot/slave/nightly-dist-rustc-win-64/build/src/librustc\middle\def.rs:79

stack backtrace:
   1:         0x71217094 - sys::backtrace::write::h702ba69fda76a133UVA
   2:         0x71231708 - rt::unwind::register::h2807fa6be024d773ZpJ
   3:         0x71183427 - rt::unwind::begin_unwind_inner::h33dce4042bd21f85onJ
   4:         0x71183beb - rt::unwind::begin_unwind_fmt::hae30e0776fdf0958ZlJ
   5:           0xf5ba4a - middle::ty::resolve_expr::h3413f822b132c794uV6
   6:          0x108d876 - middle::ty::expr_kind::h7a4229e8cf2923d94W6
   7:          0x108d589 - middle::ty::expr_is_lval::hee14165bdb90e648xW6
   8:          0x1685988 - check::UnresolvedTypeAction...std..fmt..Debug::fmt::h6fea2f9b6c32405bN8o
   9:          0x1663989 - check::callee::CallResolution&lt;'tcx&gt;.DeferredCallResolution&lt;'tcx&gt;::resolve::h620708a97b262156Qlm
  10:          0x1660e5b - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h3d9369be1c793797zjo
  11:          0x165fad8 - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h3d9369be1c793797zjo
  12:          0x16af2f8 - check::UnresolvedTypeAction...std..fmt..Debug::fmt::h6fea2f9b6c32405bN8o
  13:          0x16751e1 - check::GatherLocalsVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::hccf69f0ad25ab806Xln
  14:          0x165d854 - check::FnCtxt&lt;'a, 'tcx&gt;.AstConv&lt;'tcx&gt;::projected_ty::h3d9369be1c793797zjo
  15:          0x1672a8c - check::CheckItemTypesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_ty::hb08a5401782be257man
  16:          0x166b304 - check::CheckItemTypesVisitor&lt;'a, 'tcx&gt;.Visitor&lt;'tcx&gt;::visit_item::hbc63086752858e7d09m
  17:          0x17280d4 - check_crate::h490a1c107c2f6f04hfC
  18:          0x1723821 - check_crate::h490a1c107c2f6f04hfC
  19:         0x652deb3b - driver::phase_3_run_analysis_passes::h95f5e5d96e327896mGa
  20:         0x652c2669 - driver::compile_input::h5f994866bdbf7f9fNba
  21:         0x6538530d - run_compiler::h716ee0dff1e124acG6b
  22:         0x65383253 - run::h15ad65cc2cf082cdm6b
  23:         0x65381e1e - run::h15ad65cc2cf082cdm6b
  24:         0x7125f58c - rust_try
  25:         0x7125f569 - rust_try
  26:         0x65382597 - run::h15ad65cc2cf082cdm6b
  27:         0x71221c32 - sys::tcp::TcpListener::bind::h29247aa3f005ffa1WSE
  28:     0x7ffd672316ad - BaseThreadInitThunk
</code></pre></div>
<p dir="auto">Version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.0.0-nightly (270a677d4 2015-03-07) (built 2015-03-07)
binary: rustc
commit-hash: 270a677d4d698916f5ad103f0afc3c070b8dbeb4
commit-date: 2015-03-07
build-date: 2015-03-07
host: x86_64-pc-windows-gnu
release: 1.0.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 1.0.0-nightly (270a677d4 2015-03-07) (built 2015-03-07)
binary: rustc
commit-hash: 270a677d4d698916f5ad103f0afc3c070b8dbeb4
commit-date: 2015-03-07
build-date: 2015-03-07
host: x86_64-pc-windows-gnu
release: 1.0.0-nightly
</code></pre></div>
<hr>
<p dir="auto">The compiler seems to only panic when the enum is misspelled or missing, and passed directly as a function argument. The following (erroneous) code will not cause any compiler panics:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ }

fn use_token(token: &amp;Token) { unimplemented!() }

fn main() {
    // yields the error: type `Token` does not implement any method in scope named `LeftParens`
    // The compiler error is correct behavior.
    let token = &amp;Token::LeftParens;
    use_token(token);
}"><pre class="notranslate"><span class="pl-k">enum</span> <span class="pl-smi">Token</span> <span class="pl-kos">{</span> <span class="pl-v">LeftParen</span><span class="pl-kos">,</span> <span class="pl-v">RightParen</span><span class="pl-kos">,</span> <span class="pl-v">Plus</span><span class="pl-kos">,</span> <span class="pl-v">Minus</span><span class="pl-kos">,</span> <span class="pl-c">/* etc */</span> <span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">use_token</span><span class="pl-kos">(</span><span class="pl-s1">token</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Token</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">unimplemented</span><span class="pl-en">!</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-c">// yields the error: type `Token` does not implement any method in scope named `LeftParens`</span>
    <span class="pl-c">// The compiler error is correct behavior.</span>
    <span class="pl-k">let</span> token = <span class="pl-c1">&amp;</span><span class="pl-smi">Token</span><span class="pl-kos">::</span><span class="pl-v">LeftParens</span><span class="pl-kos">;</span>
    <span class="pl-en">use_token</span><span class="pl-kos">(</span>token<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ }

fn use_token(token: &amp;Token) { unimplemented!() }

fn main() {
    // spelled correctly; compiles successfully
    use_token(&amp;Token::LeftParen);
}"><pre class="notranslate"><span class="pl-k">enum</span> <span class="pl-smi">Token</span> <span class="pl-kos">{</span> <span class="pl-v">LeftParen</span><span class="pl-kos">,</span> <span class="pl-v">RightParen</span><span class="pl-kos">,</span> <span class="pl-v">Plus</span><span class="pl-kos">,</span> <span class="pl-v">Minus</span><span class="pl-kos">,</span> <span class="pl-c">/* etc */</span> <span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">use_token</span><span class="pl-kos">(</span><span class="pl-s1">token</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Token</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">unimplemented</span><span class="pl-en">!</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-c">// spelled correctly; compiles successfully</span>
    <span class="pl-en">use_token</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-smi">Token</span><span class="pl-kos">::</span><span class="pl-v">LeftParen</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>