From 888811b0598aa18c3e41d1c03f4caf6cd794eaa4 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 22 Feb 2021 19:02:02 +0800 Subject: [PATCH 1/3] Add Future trait for doc_spotlight feature doc --- src/doc/unstable-book/src/language-features/doc-spotlight.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/unstable-book/src/language-features/doc-spotlight.md b/src/doc/unstable-book/src/language-features/doc-spotlight.md index 8117755fef1c8..00a05e509b87c 100644 --- a/src/doc/unstable-book/src/language-features/doc-spotlight.md +++ b/src/doc/unstable-book/src/language-features/doc-spotlight.md @@ -5,8 +5,8 @@ The tracking issue for this feature is: [#45040] The `doc_spotlight` feature allows the use of the `spotlight` parameter to the `#[doc]` attribute, to "spotlight" a specific trait on the return values of functions. Adding a `#[doc(spotlight)]` attribute to a trait definition will make rustdoc print extra information for functions which return -a type that implements that trait. This attribute is applied to the `Iterator`, `io::Read`, and -`io::Write` traits in the standard library. +a type that implements that trait. This attribute is applied to the `Iterator`, `io::Read`, +`io::Write` and `Future` traits in the standard library. You can do this on your own traits, like this: From e56364fa995ce0e8e607fabdd4b959d3da848e2c Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 24 Feb 2021 22:35:03 +0800 Subject: [PATCH 2/3] Use Oxform comma Co-authored-by: Nathan Nguyen <43092380+nhwn@users.noreply.github.com> --- src/doc/unstable-book/src/language-features/doc-spotlight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/unstable-book/src/language-features/doc-spotlight.md b/src/doc/unstable-book/src/language-features/doc-spotlight.md index 00a05e509b87c..9f2ee9aecf472 100644 --- a/src/doc/unstable-book/src/language-features/doc-spotlight.md +++ b/src/doc/unstable-book/src/language-features/doc-spotlight.md @@ -6,7 +6,7 @@ The `doc_spotlight` feature allows the use of the `spotlight` parameter to the ` to "spotlight" a specific trait on the return values of functions. Adding a `#[doc(spotlight)]` attribute to a trait definition will make rustdoc print extra information for functions which return a type that implements that trait. This attribute is applied to the `Iterator`, `io::Read`, -`io::Write` and `Future` traits in the standard library. +`io::Write`, and `Future` traits in the standard library. You can do this on your own traits, like this: From 27f7a2e18d456a161382f51a1db6402b36ca0b24 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 27 Feb 2021 01:29:56 +0800 Subject: [PATCH 3/3] Add for example word to spotlight doc As suggested by GuillaumeGomez --- src/doc/unstable-book/src/language-features/doc-spotlight.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/unstable-book/src/language-features/doc-spotlight.md b/src/doc/unstable-book/src/language-features/doc-spotlight.md index 9f2ee9aecf472..75eff16331898 100644 --- a/src/doc/unstable-book/src/language-features/doc-spotlight.md +++ b/src/doc/unstable-book/src/language-features/doc-spotlight.md @@ -5,8 +5,8 @@ The tracking issue for this feature is: [#45040] The `doc_spotlight` feature allows the use of the `spotlight` parameter to the `#[doc]` attribute, to "spotlight" a specific trait on the return values of functions. Adding a `#[doc(spotlight)]` attribute to a trait definition will make rustdoc print extra information for functions which return -a type that implements that trait. This attribute is applied to the `Iterator`, `io::Read`, -`io::Write`, and `Future` traits in the standard library. +a type that implements that trait. For example, this attribute is applied to the `Iterator`, +`io::Read`, `io::Write`, and `Future` traits in the standard library. You can do this on your own traits, like this: