Skip to content

semicolon_if_nothing_returned on an attribute macro #12123

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
Gingeh opened this issue Jan 11, 2024 · 1 comment · Fixed by #12167
Closed

semicolon_if_nothing_returned on an attribute macro #12123

Gingeh opened this issue Jan 11, 2024 · 1 comment · Fixed by #12167
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

Comments

@Gingeh
Copy link

Gingeh commented Jan 11, 2024

Summary

Clippy suggests to add a semicolon after the pollster::main attribute macro. Interestingly, it doesn't trigger when the function is written on a single line.

Lint Name

semicolon_if_nothing_returned

Reproducer

I tried this code:

#[pollster::main]
async fn main() {
}

I saw this happen:

warning: consider adding a `;` to the last statement for consistent formatting
 --> src/main.rs:1:1
  |
1 | #[pollster::main]
  | ^^^^^^^^^^^^^^^^^ help: add a `;` here: `#[pollster::main];`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
  = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
  = help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]`

Version

rustc 1.77.0-nightly (75c68cfd2 2024-01-07)
binary: rustc
commit-hash: 75c68cfd2b9870f2953b62d250bd7d0564a7b56d
commit-date: 2024-01-07
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Additional Labels

  • I-suggestion-causes-error
  • T-macros
@Gingeh Gingeh 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 Jan 11, 2024
@J-ZhengLi
Copy link
Member

J-ZhengLi commented Jan 16, 2024

@rustbot claim

kinda looks like the same problem I encountered in this one, now I think it might be the quote_spanned's fault lol, I'll look into it tho...

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants