t = T&gt;，如下所示：</p>
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">#![allow(unused)]
</span><span class="boring">fn main() {
</span>fn add&lt;T&gt;(x: T, y: T) -&gt; T
where
    T: Copy,
    dyn std::ops::Add&lt;Output = T&gt; + 'static,
{
    x + y
}

let x = 1;
let y = 2;
let z = add(x, y);

<span class="boring">}</span></code></pre></pre>
<p>在上面的例子中，add 函数使用了 trait 对象 dyn std::ops::Add&lt;Output = T&gt;，它表示实现