3 The tracking issue for this feature is: [#45040]
5 The `doc_spotlight` feature allows the use of the `spotlight` parameter to the `#[doc]` attribute,
6 to "spotlight" a specific trait on the return values of functions. Adding a `#[doc(spotlight)]`
7 attribute to a trait definition will make rustdoc print extra information for functions which return
8 a type that implements that trait. This attribute is applied to the `Iterator`, `io::Read`, and
9 `io::Write` traits in the standard library.
11 You can do this on your own traits, like this:
14 #![feature(doc_spotlight)]
20 impl MyTrait for MyStruct {}
22 /// The docs for this function will have an extra line about `MyStruct` implementing `MyTrait`,
23 /// without having to write that yourself!
24 pub fn my_fn() -> MyStruct { MyStruct }
27 This feature was originally implemented in PR [#45039].
29 [#45040]: https://github.com/rust-lang/rust/issues/45040
30 [#45039]: https://github.com/rust-lang/rust/pull/45039