Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

todo! documentation should mention optional format arguments #116130

Closed
2 tasks
Marcono1234 opened this issue Sep 25, 2023 · 3 comments · Fixed by #116363
Closed
2 tasks

todo! documentation should mention optional format arguments #116130

Marcono1234 opened this issue Sep 25, 2023 · 3 comments · Fixed by #116363
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@Marcono1234
Copy link

Marcono1234 commented Sep 25, 2023

Location

https://doc.rust-lang.org/std/macro.todo.html

Summary

The documentation of the todo! macro currently does not mention at all that it also accepts optional format arguments, for example:

todo!("with {}", 1);

Other macros like unimplemented! at least have the following sentence under "Panics":

Like panic!, this macro has a second form for displaying custom values.

So maybe it would be good to do the following?

@Marcono1234 Marcono1234 added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Sep 25, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 25, 2023
@saethlin saethlin added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 25, 2023
@Colonial-Dev
Copy link
Contributor

@rustbot claim

@Colonial-Dev
Copy link
Contributor

Any opinions?

I mostly drew from the docs for unimplemented!, and I also took the liberty of cleaning up some of the formatting/typography.

@Marcono1234
Copy link
Author

Thanks! To me this looks good, but I don't know what the maintainers think.

@bors bors closed this as completed in 0363cc5 Oct 4, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 4, 2023
Rollup merge of rust-lang#116363 - Colonial-Dev:issue-116130-fix, r=thomcc

Adapt `todo!` documentation to mention displaying custom values

Resolves rust-lang#116130.

I copied from the [existing documentation](https://doc.rust-lang.org/std/macro.unimplemented.html) for `unimplemented!` more or less directly, down to the example trait used. I also took the liberty of fixing some formatting and typographical errors that I noticed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants