Skip to content

[Rustdoc] Show #[must_use] on functions #48485

New issue

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

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

Already on GitHub? Sign in to your account

Closed
Havvy opened this issue Feb 23, 2018 · 4 comments
Closed

[Rustdoc] Show #[must_use] on functions #48485

Havvy opened this issue Feb 23, 2018 · 4 comments
Assignees
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Havvy
Copy link
Contributor

Havvy commented Feb 23, 2018

As it's important information about the function, Rustdoc should show that the result of the function must be used.

@QuietMisdreavus QuietMisdreavus added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 23, 2018
@GuillaumeGomez
Copy link
Member

Adding it.

@GuillaumeGomez GuillaumeGomez self-assigned this Feb 24, 2018
@GuillaumeGomez
Copy link
Member

Hum actually, how would the function show that the returned type should be used?

cc @rust-lang/docs

@frewsxcv
Copy link
Member

Some history: #37012

@QuietMisdreavus
Copy link
Member

I imagine, for bare functions, the #[must_use] attribute would be shown the same way as attributes are shown on structs. The problem comes in on associated methods on structs and traits. They don't have the same visual language as bare functions do, but they can get #[must_use] attributes the same way.

@jkordish jkordish added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Apr 18, 2018
@steveklabnik steveklabnik removed the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label May 28, 2018
bors added a commit that referenced this issue Jun 3, 2018
…uietMisdreavus

Add attributes for trait and methods as well

Fixes #48485.

r? @QuietMisdreavus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants