Change:
It should work a bit like IDE's feature that finds everything that implements a given interface.
This should be a fairly small change (the most annoying part has already been done) so i'll open this up as a mentored issue. The bit that writes out the "Implementors" section is in . This is where the known implementors for a given trait are pulled out of the global context and listed out onto the rendered page. The bit that's responsible for creating links is , implemented on a local type. This kind of Item is easily made from the kind of Item that's otherwise worked on in , but there's a catch: The entries in the Implementors list aren't s. They're s, which are only a subset of the things you get on an Item. This is the "most annoying part" i mentioned earlier. Fortunately, i ran into this when creating the "Implementations on Foreign Types" section, so if you scroll up a little in , you can see so i could render the full impl block for them. The task for anyone who wants to take this on is to pull that up a little so that it's used for all the implementors, not just the foreign ones. With a in hand, combine it with the Context to create a and call to generate the link. ( This also helpfully includes the extra HTML bits that will flush the link to the right edge, which is really the final step.) And... that's it! The link should probably go between the and the where clause underneath it, so that it's aligned with the impl line and not the where clause. You may need to also close/open the that's wrapping the whole line to make sure the link itself isn't monospace. If you have any questions, let me know! Either comment here, or hop onto IRC in , or the impl period Gitter under .

Discussion:
document(w, cx, it) } <ins> fn implementor2item<'a>(cache: &'a Cache, imp : &Implementor) -> Option<&'a clean::Item> { if let Some(t_did) = imp.impl_.for_.def_id() { if let Some(impl_item) = cache.impls.get(&t_did).and_then(|i| i.iter() .find(|i| i.impl_item.def_id == imp.def_id)) { let i = &impl_item.impl_item; return Some(i); } } None } </ins> fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, t: &clean::Trait) -> fmt::Result { let mut bounds = String::new();

")?; for implementor in foreign { <del> // need to get from a clean::Impl to a clean::Item so i can use render_impl if let Some(t_did) = implementor.impl_.for_.def_id() { if let Some(impl_item) = cache.impls.get(&t_did).and_then(|i| i.iter() .find(|i| i.impl_item.def_id == implementor.def_id)) { let i = &impl_item.impl_item; let impl_ = Impl { impl_item: i.clone() }; let assoc_link = AssocItemLink::GotoSource( i.def_id, &implementor.impl_.provided_trait_methods ); render_impl(w, cx, &impl_, assoc_link, RenderMode::Normal, i.stable_since(), false)?; } </del> <ins> if let Some(i) = implementor2item(&cache, implementor) { let impl_ = Impl { impl_item: i.clone() }; let assoc_link = AssocItemLink::GotoSource( i.def_id, &implementor.impl_.provided_trait_methods ); render_impl(w, cx, &impl_, assoc_link, RenderMode::Normal, i.stable_since(), false)?; </ins> } } }

write!(w, "{}", impl_header)?; for implementor in local { <del> write!(w, "<li><code>")?; </del> <ins> write!(w, "<li>")?; if let Some(item) = implementor2item(&cache, implementor) { if let Some(l) = (Item { cx, item }).src_href() { write!(w, "<div class='out-of-band'>")?; write!(w, "<a class='srclink' href='{}' title='{}'>[src]</a>", l, "goto source code")?; write!(w, "</div>")?; } } write!(w, "<code>")?; </ins> // If there's already another implementor that has the same abbridged name, use the // full path, for example in `std::iter::ExactSizeIterator` let use_absolute = match implementor.impl_.for_ {

h3.impl, h3.method, h3.type { margin-top: 15px; } <del> h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle { </del> <ins> h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle, ul.item-list > li > .out-of-band { </ins> font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; }

font-size: 19px; } <ins> ul.item-list > li > .out-of-band { font-size: 19px; } </ins> h4 > code, h3 > code, .invisible > code { position: inherit; }

<ins> // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-cross-compile #![crate_name = "foo"] pub trait SomeTrait {} pub struct SomeStruct; // @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#19' impl SomeTrait for usize {} // @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#22-24' impl SomeTrait for SomeStruct { // deliberately multi-line impl } </ins>