Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function #50721
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
P-medium
Medium priority
Uh oh!
There was an error while loading. Please reload this page.
Towards the end of this section in the rustdoc book, we suggest wrapping functions that utilize
?
withfn foo() -> io::Result<()> { .. }
.Now that the
Termination
trait has stabilized, we can recommend using that instead of this hiddenfoo
function. For examples of what I mean, see this pull request.@steveklabnik is happy to mentor anyone who wants to do this. Here's the basic outline of what needs to happen:
Here's the file that needs to be modified: https://github.com/rust-lang/rust/blob/master/src/doc/rustdoc/src/documentation-tests.md
The part that starts with:
This should be moved into its own section, "Using
?
in doc tests", and instead of wrapping it in a function, it should suggest something similar to the diff above.If you have any questions about this, don't hesitate to ask in a comment below!
The text was updated successfully, but these errors were encountered: