=</span> <span class='number'>5u8</span>;
    <span class='ident'>do_something</span>(<span class='kw-2'>&amp;</span><span class='ident'>x</span> <span class='kw'>as</span> <span class='kw-2'>&amp;</span><span class='ident'>Foo</span>);
}</pre>

<!-- or by coercing: -->

<p>または型強制によって、</p>

<span class='rusttest'>trait Foo { fn method(&amp;self) -&gt; String; }
impl Foo for u8 { fn method(&amp;self) -&gt; String { format!(&quot;u8: {}&quot;, *self) } }
impl Foo for String { fn method(&