Skip to content

todo! documentation should mention optional format arguments #116130

Closed
@Marcono1234

Description

@Marcono1234

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?

  • Update the "Panics" section to be similar to https://doc.rust-lang.org/std/macro.unimplemented.html#panics
    Extend / adjust example to also show usage of custom message

Activity

added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Sep 25, 2023
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Sep 25, 2023
added
T-libsRelevant to the library team, which will review and decide on the PR/issue.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Sep 25, 2023
Colonial-Dev

Colonial-Dev commented on Oct 1, 2023

@Colonial-Dev
Contributor

@rustbot claim

Colonial-Dev

Colonial-Dev commented on Oct 2, 2023

@Colonial-Dev
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

Marcono1234 commented on Oct 2, 2023

@Marcono1234
Author

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

added a commit that references this issue on Oct 4, 2023

Rollup merge of rust-lang#116363 - Colonial-Dev:issue-116130-fix, r=t…

0363cc5
added a commit that references this issue on Oct 4, 2023
278e144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @Marcono1234@saethlin@Colonial-Dev@rustbot

    Issue actions

      `todo!` documentation should mention optional format arguments · Issue #116130 · rust-lang/rust