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

empty_docs triggered in proc-macros #12377

Closed
daxpedda opened this issue Feb 28, 2024 · 6 comments · Fixed by #12466
Closed

empty_docs triggered in proc-macros #12377

daxpedda opened this issue Feb 28, 2024 · 6 comments · Fixed by #12466
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have T-macros Type: Issues with macros and macro expansion

Comments

@daxpedda
Copy link
Contributor

daxpedda commented Feb 28, 2024

Summary

The just newly introduced #12342 is triggered in proc-macros.

Lint Name

empty_docs

Reproducer

I tried this code:

#[wasm_bindgen]
extern "C" {
	type Test;
}

I saw this happen:

warning: empty doc comment
   --> tests/util/web.rs:141:1
    |
141 | #[wasm_bindgen]
    | ^^^^^^^^^^^^^^^
    |
    = help: consider removing or filling it
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
    = note: this warning originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

I expected to see this happen:
The lint not to trigger.

Version

rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: x86_64-unknown-linux-gnu
release: 1.76.0
LLVM version: 17.0.6

Additional Labels

@rustbot label +T-macros

@daxpedda daxpedda added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Feb 28, 2024
@rustbot rustbot added the T-macros Type: Issues with macros and macro expansion label Feb 28, 2024
ilyagr added a commit to ilyagr/jj that referenced this issue Mar 2, 2024
There are a few additionaly warnings because of
rust-lang/rust-clippy#12377, which is a
nightly-only bug that will hopefully be fixed.
ilyagr added a commit to ilyagr/jj that referenced this issue Mar 2, 2024
There are a few additional warnings because of
rust-lang/rust-clippy#12377, which is a
nightly-only bug that will hopefully be fixed.
ilyagr added a commit to ilyagr/jj that referenced this issue Mar 3, 2024
There are a few additional warnings because of
rust-lang/rust-clippy#12377, which is a
nightly-only bug that will hopefully be fixed.
ilyagr added a commit to jj-vcs/jj that referenced this issue Mar 3, 2024
There are a few additional warnings because of
rust-lang/rust-clippy#12377, which is a
nightly-only bug that will hopefully be fixed.
jamesmistry added a commit to jamesmistry/breadlog that referenced this issue Mar 7, 2024
@J-ZhengLi
Copy link
Member

@rustbot claim

@ilyagr
Copy link

ilyagr commented Mar 19, 2024

I'm still getting this problem, even on the new beta release.

They show up in cli/src/template_parser.rs and lib/src/revset.rs of https://github.com/martinvonz/jj/tree/f865c1bc5d96f609d2919d559de045dda8256c7c.

(There are also many additional assigning_clones false positives due to #12467)

rustc 1.78.0-beta.1 (efd9d2df1 2024-03-18)
binary: rustc
commit-hash: efd9d2df12b5e17fac0b4d0fb89f612ecd79f259
commit-date: 2024-03-18
host: aarch64-apple-darwin
release: 1.78.0-beta.1
LLVM version: 18.1.2

Update: I'm also getting the same behavior with the latest nightly:

rustc 1.79.0-nightly (3c85e56 2024-03-18)
binary: rustc
commit-hash: 3c85e56
commit-date: 2024-03-18
host: aarch64-apple-darwin
release: 1.79.0-nightly
LLVM version: 18.1.2

ilyagr added a commit to ilyagr/jj that referenced this issue Mar 19, 2024
There are still some warnings from (seemingly) clippy bugs. Quoting
myself from Discord:

> PSA: the latest beta cargo clippy (from Rust 1.78) has some problems
> that affect jj: rust-lang/rust-clippy#12467
> and rust-lang/rust-clippy#12377.  You could
> disable clippy::assigning_clones and clippy::empty_docs as a workaround.
> VS Code can disable them in rust-analyzer, you can also use
> https://github.com/ericseppanen/cargo-cranky (you can put Cranky.toml in
> the per-user gitignore).
@y21
Copy link
Member

y21 commented Mar 20, 2024

The fix isn't on nightly yet (clippy is only sync'd with upstream every two weeks, I believe the next sync happens on the 21st), so you'll have to wait a bit longer, or you could try to run clippy master locally on your project to confirm that this is fixed (or isn't fixed).

@ilyagr
Copy link

ilyagr commented Mar 20, 2024

I see, thanks for letting me know!

Will the fix be backported to 1.78 stable?

I'm not sure I know how to run the master clippy. I thought that was what nightly was for...

@y21
Copy link
Member

y21 commented Mar 20, 2024

I'm not sure I know how to run the master clippy.

The easiest way is cloning this repository, cd'ing into it and running cargo dev lint /path/to/your/project.

@ilyagr
Copy link

ilyagr commented Mar 20, 2024

Thanks! Indeed, that doesn't seem to trigger clippy::empty_docs, so I think the fix works.

ilyagr added a commit to jj-vcs/jj that referenced this issue Mar 20, 2024
There are still some warnings from (seemingly) clippy bugs. Quoting
myself from Discord:

> PSA: the latest beta cargo clippy (from Rust 1.78) has some problems
> that affect jj: rust-lang/rust-clippy#12467
> and rust-lang/rust-clippy#12377.  You could
> disable clippy::assigning_clones and clippy::empty_docs as a workaround.
> VS Code can disable them in rust-analyzer, you can also use
> https://github.com/ericseppanen/cargo-cranky (you can put Cranky.toml in
> the per-user gitignore).
mergify bot pushed a commit to libp2p/rust-libp2p that referenced this issue Mar 25, 2024
guillaumemichel pushed a commit to libp2p/rust-libp2p that referenced this issue Mar 28, 2024
mbfm added a commit to eclipse-opendut/opendut that referenced this issue May 8, 2024
The many 'empty doc comment' warnings are a bug in Clippy: rust-lang/rust-clippy#12377
mtwardawski pushed a commit to mtwardawski/opendut that referenced this issue May 10, 2024
The many 'empty doc comment' warnings are a bug in Clippy: rust-lang/rust-clippy#12377
taiki-e added a commit to openrr/openrr that referenced this issue May 13, 2024
rust-lang/rust-clippy#12377

```
error: empty doc comment
  --> openrr-plugin/src/gen/proxy.rs:10:1
   |
10 | #[sabi_trait]
   | ^^^^^^^^^^^^^
   |
   = help: consider removing or filling it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
   = note: `-D clippy::empty-docs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::empty_docs)]`
   = note: this error originates in the attribute macro `sabi_trait` (in Nightly builds, run with -Z macro-backtrace for more info)
```
taiki-e added a commit to openrr/openrr that referenced this issue May 13, 2024
rust-lang/rust-clippy#12377

```
error: empty doc comment
  --> openrr-plugin/src/gen/proxy.rs:10:1
   |
10 | #[sabi_trait]
   | ^^^^^^^^^^^^^
   |
   = help: consider removing or filling it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
   = note: `-D clippy::empty-docs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::empty_docs)]`
   = note: this error originates in the attribute macro `sabi_trait` (in Nightly builds, run with -Z macro-backtrace for more info)
```
taiki-e added a commit to openrr/openrr that referenced this issue May 13, 2024
rust-lang/rust-clippy#12377

```
error: empty doc comment
  --> openrr-plugin/src/gen/proxy.rs:10:1
   |
10 | #[sabi_trait]
   | ^^^^^^^^^^^^^
   |
   = help: consider removing or filling it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
   = note: `-D clippy::empty-docs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::empty_docs)]`
   = note: this error originates in the attribute macro `sabi_trait` (in Nightly builds, run with -Z macro-backtrace for more info)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have T-macros Type: Issues with macros and macro expansion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants