From 7488558d53e6d3ba7f5d5c0221a7aca06327e29d Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Sat, 21 Nov 2020 00:17:13 -0800 Subject: [PATCH 1/2] Use `doc`, not `test` for fn item inner attr example Using `test` causes a deny-by-default lint to trigger. See https://github.com/rust-lang/rust/pull/79003 for more information. --- src/items/functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/items/functions.md b/src/items/functions.md index f76991cf0..083b88f5f 100644 --- a/src/items/functions.md +++ b/src/items/functions.md @@ -295,7 +295,7 @@ available while running tests. ```rust fn test_only() { - #![test] + #![doc("Example")] } ``` From 645a7b1a809842f03e71f7211b1e22ee301a703a Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Wed, 25 Nov 2020 12:44:05 -0800 Subject: [PATCH 2/2] Address review comments --- src/items/functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/items/functions.md b/src/items/functions.md index 083b88f5f..27dbef24b 100644 --- a/src/items/functions.md +++ b/src/items/functions.md @@ -290,12 +290,12 @@ responsibility to ensure that. [Outer attributes][attributes] are allowed on functions. [Inner attributes][attributes] are allowed directly after the `{` inside its [block]. -This example shows an inner attribute on a function. The function will only be -available while running tests. +This example shows an inner attribute on a function. The function is documented +with just the word "Example". ```rust -fn test_only() { - #![doc("Example")] +fn documented() { + #![doc = "Example"] } ```