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

False positive of just_underscores_and_digits when missing R_ANGLE when ending type prameters #12302

Closed
liquidhelium opened this issue Feb 16, 2024 · 1 comment · Fixed by #14168
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

@liquidhelium
Copy link

Summary

As it's said in the title, something like Type<T will trigger this bug.

Lint Name

clippy::just_underscores_and_digits

Reproducer

pub struct Aa<T>(PhantomData<T>);

fn aa(a: Aa<String) {

}

I saw this happen:

warning: consider choosing a more descriptive name
   --> rizlium_editor/src/extensions/editing/world_view/cam_response.rs:130:13
    |
130 | fn aa(a: Aa<String) {
    |             ^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#just_underscores_and_digits
    = note: `#[warn(clippy::just_underscores_and_digits)]` on by default

also, regular "Syntax error" did worked.

Version

rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6

Additional Labels

No response

@liquidhelium liquidhelium 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 16, 2024
@Centri3
Copy link
Member

Centri3 commented Feb 17, 2024

My best guess is that the parser tries to recover while giving the type parameters dummy values (probably using DummyAstNode). I don't really know if it's worth it to fix this

github-merge-queue bot pushed a commit that referenced this issue Feb 11, 2025
…nario (#14168)

Fixes #12302

changelog: [`just_underscores_and_digits`]: fix false positive in error
recovery scenario
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