Skip to content
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

[Merged by Bors] - fixes complaints about missing docs #4551

Closed
wants to merge 4 commits into from

Conversation

CGMossa
Copy link
Contributor

@CGMossa CGMossa commented Apr 21, 2022

Objective

When using derive(WorldQuery), then clippy complains with the following:

warning: missing documentation for a struct
  --> src\wild_boar_type\marker_vital_status.rs:35:17
   |
35 | #[derive(Debug, WorldQuery)]
   |                 ^^^^^^^^^^
   |
   = note: this warning originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)

Solution

  • Either #[doc(hidden)] or
  • Add a generic documentation line to it.

I don't know what is preferred, but I'd gladly add it in here.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Apr 21, 2022
@CGMossa CGMossa marked this pull request as ready for review April 21, 2022 11:27
@alice-i-cecile
Copy link
Member

Preference is for generic documentation line; this struct was deliberately not hidden.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Apr 21, 2022
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
@CGMossa
Copy link
Contributor Author

CGMossa commented Apr 21, 2022

Wait, isn't it meant to inherit the docstring on the derived struct?

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 21, 2022

Why not just silence the lint?

@CGMossa
Copy link
Contributor Author

CGMossa commented Apr 21, 2022

@bjorn3 this is dealt with in packages like derive_more, so I thought it should be dealt with here as well.

@alice-i-cecile
Copy link
Member

Yep; silencing the lint won't work with forbid missing docs either.

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 21, 2022

#[automatically_derived] reliably silences the missing_docs lint as well as several others, even with #![forbid(missing_docs)]. This attribute is used by all builtin derives as well as custom derives like serde::Serialize. https://stackoverflow.com/questions/51481551/what-does-automatically-derived-mean

@alice-i-cecile
Copy link
Member

Excellent, thank you @bjorn3. I'd seen allow fail, but didn't know about automatically_derived.

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Apr 22, 2022
# Objective

When using `derive(WorldQuery)`, then clippy complains with the following:

```rust
warning: missing documentation for a struct
  --> src\wild_boar_type\marker_vital_status.rs:35:17
   |
35 | #[derive(Debug, WorldQuery)]
   |                 ^^^^^^^^^^
   |
   = note: this warning originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
```

## Solution

* Either `#[doc(hidden)]` or
* Add a generic documentation line to it.

I don't know what is preferred, but I'd gladly add it in here.
@bors bors bot changed the title fixes complaints about missing docs [Merged by Bors] - fixes complaints about missing docs Apr 22, 2022
@bors bors bot closed this Apr 22, 2022
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
# Objective

When using `derive(WorldQuery)`, then clippy complains with the following:

```rust
warning: missing documentation for a struct
  --> src\wild_boar_type\marker_vital_status.rs:35:17
   |
35 | #[derive(Debug, WorldQuery)]
   |                 ^^^^^^^^^^
   |
   = note: this warning originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
```

## Solution

* Either `#[doc(hidden)]` or
* Add a generic documentation line to it.

I don't know what is preferred, but I'd gladly add it in here.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

When using `derive(WorldQuery)`, then clippy complains with the following:

```rust
warning: missing documentation for a struct
  --> src\wild_boar_type\marker_vital_status.rs:35:17
   |
35 | #[derive(Debug, WorldQuery)]
   |                 ^^^^^^^^^^
   |
   = note: this warning originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
```

## Solution

* Either `#[doc(hidden)]` or
* Add a generic documentation line to it.

I don't know what is preferred, but I'd gladly add it in here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior C-Docs An addition or correction to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants