Files
rust/tests/rustdoc-html/where.SWhere_TraitWhere_item-decl.html
Noah Lev afaa98372c rustdoc: Keep external impls of notable traits
The code predating this PR was actually incorrect since it did not keep
these impls. However, removing the redundant deref-following logic had
the side effect of breaking a GUI test for the notable traits tooltip.
It seems like previously an unrelated type with a deref impl to
`Vec<u8>` ended up causing the impl of `Write` for it to be kept.

In fact, this change required some snapshot tests to be updated because
it fixed a latent bug where the notable trait tooltip would not appear
for many external traits (if they didn't happen to get pulled in like
`Write for Vec<u8>` did).
2026-07-21 18:16:01 +00:00

13 lines
1.3 KiB
HTML

<pre class="rust item-decl"><code>pub trait TraitWhere {
type <a href="#associatedtype.Item" class="associatedtype">Item</a>&lt;'a&gt;
<span class="where">where Self: 'a</span>;
// Provided methods
fn <a href="#method.func" class="fn">func</a>(self)
<span class="where">where Self: <a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer" /> fn <a href="#method.lines" class="fn">lines</a>(self) -&gt; <a class="struct" href="{{channel}}/alloc/io/util/struct.Lines.html" title="struct alloc::io::util::Lines">Lines</a>&lt;Self&gt; <a href="#" class="tooltip" data-notable-ty="Lines&lt;Self&gt;">&#9432;</a>
<span class="where">where Self: <a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer" /> fn <a href="#method.merge" class="fn">merge</a>&lt;T&gt;(self, a: T)
<span class="where">where Self: <a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
T: <a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
}</code></pre>