-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
unconditional_recursion false positive in PartialEq field comparison (2) #12133
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
dtolnay
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 12, 2024
dtolnay
added a commit
to serde-rs/json
that referenced
this issue
Jan 12, 2024
rust-lang/rust-clippy#12133 warning: function cannot return without recursing --> src/map.rs:276:5 | 276 | / fn eq(&self, other: &Self) -> bool { 277 | | self.map.eq(&other.map) 278 | | } | |_____^ | note: recursive call site --> src/map.rs:277:9 | 277 | self.map.eq(&other.map) | ^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion = note: `-W clippy::unconditional-recursion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::unconditional_recursion)]`
dtolnay
added a commit
to dtolnay/cargo-tally
that referenced
this issue
Jan 12, 2024
rust-lang/rust-clippy#12133 warning: function cannot return without recursing --> src/cratename.rs:47:5 | 47 | / fn eq(&self, rhs: &Self) -> bool { 48 | | CrateNameQuery::ref_cast(&self.0).eq(CrateNameQuery::ref_cast(&rhs.0)) 49 | | } | |_____^ | note: recursive call site --> src/cratename.rs:48:9 | 48 | CrateNameQuery::ref_cast(&self.0).eq(CrateNameQuery::ref_cast(&rhs.0)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion = note: `-W clippy::unconditional-recursion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::unconditional_recursion)]` warning: function cannot return without recursing --> src/user.rs:42:5 | 42 | / fn eq(&self, rhs: &Self) -> bool { 43 | | UserQuery::ref_cast(&self.0).eq(UserQuery::ref_cast(&rhs.0)) 44 | | } | |_____^ | note: recursive call site --> src/user.rs:43:9 | 43 | UserQuery::ref_cast(&self.0).eq(UserQuery::ref_cast(&rhs.0)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
dtolnay
added a commit
to dtolnay/syn
that referenced
this issue
Jan 12, 2024
rust-lang/rust-clippy#12133 warning: function cannot return without recursing --> src/lifetime.rs:90:5 | 90 | / fn eq(&self, other: &Lifetime) -> bool { 91 | | self.ident.eq(&other.ident) 92 | | } | |_____^ | note: recursive call site --> src/lifetime.rs:91:9 | 91 | self.ident.eq(&other.ident) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion = note: `-W clippy::unconditional-recursion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::unconditional_recursion)]`
dtolnay
added a commit
to dtolnay/cxx
that referenced
this issue
Jan 12, 2024
rust-lang/rust-clippy#12133 warning: function cannot return without recursing --> gen/build/src/cargo.rs:91:5 | 91 | / fn eq(&self, rhs: &Self) -> bool { 92 | | Lookup::new(&self.0).eq(Lookup::new(&rhs.0)) 93 | | } | |_____^ | note: recursive call site --> gen/build/src/cargo.rs:92:9 | 92 | Lookup::new(&self.0).eq(Lookup::new(&rhs.0)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion = note: `-W clippy::unconditional-recursion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::unconditional_recursion)]`
This was referenced Jan 12, 2024
Thanks for the issue! I'll fix it as soon as possible. |
13 tasks
5 tasks
zeenix
added a commit
to zeenix/zbus
that referenced
this issue
Jan 15, 2024
zeenix
added a commit
to zeenix/zbus
that referenced
this issue
Jan 15, 2024
5 tasks
4 tasks
primeos-work
added a commit
to primeos-work/butido
that referenced
this issue
Feb 19, 2024
The `suspicious_open_options` lint [0] warns that the truncation behaviour should be made explicit when creating new files. We also set `create_new(true)`, which ensures that a new file will *always* be created so we should simply drop `create(true)` since it has no effect anyway: "If `.create_new(true)` is set, `.create()` and `.truncate()` are ignored." [1] The `unconditional_recursion` lint [2] also emits a warning but that's a false positive and should already be fixed in nightly (see [3] for a very similar case and [4] for the PR that should fix it). In our case we're comparing tuples with just two fields of the `Package` structure so it isn't recursive. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#/suspicious_open_options [1]: https://docs.rs/tokio/1.34.0/tokio/fs/struct.OpenOptions.html#method.create_new [2]: https://rust-lang.github.io/rust-clippy/master/index.html#/unconditional_recursion [3]: rust-lang/rust-clippy#12133 [4]: rust-lang/rust-clippy#12137
primeos-work
added a commit
to primeos-work/butido
that referenced
this issue
Feb 19, 2024
The `suspicious_open_options` lint [0] warns that the truncation behaviour should be made explicit when creating new files. We also set `create_new(true)`, which ensures that a new file will *always* be created so we should simply drop `create(true)` since it has no effect anyway: "If `.create_new(true)` is set, `.create()` and `.truncate()` are ignored." [1] The `unconditional_recursion` lint [2] also emits a warning but that's a false positive and should already be fixed in nightly (see [3] for a very similar case and [4] for the PR that should fix it). In our case we're comparing tuples with just two fields of the `Package` structure so it isn't recursive. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#/suspicious_open_options [1]: https://docs.rs/tokio/1.34.0/tokio/fs/struct.OpenOptions.html#method.create_new [2]: https://rust-lang.github.io/rust-clippy/master/index.html#/unconditional_recursion [3]: rust-lang/rust-clippy#12133 [4]: rust-lang/rust-clippy#12137 Signed-off-by: Michael Weiss <michael.weiss@eviden.com>
ammernico
pushed a commit
to ammernico/butido
that referenced
this issue
Apr 30, 2024
The `suspicious_open_options` lint [0] warns that the truncation behaviour should be made explicit when creating new files. We also set `create_new(true)`, which ensures that a new file will *always* be created so we should simply drop `create(true)` since it has no effect anyway: "If `.create_new(true)` is set, `.create()` and `.truncate()` are ignored." [1] The `unconditional_recursion` lint [2] also emits a warning but that's a false positive and should already be fixed in nightly (see [3] for a very similar case and [4] for the PR that should fix it). In our case we're comparing tuples with just two fields of the `Package` structure so it isn't recursive. [0]: https://rust-lang.github.io/rust-clippy/master/index.html#/suspicious_open_options [1]: https://docs.rs/tokio/1.34.0/tokio/fs/struct.OpenOptions.html#method.create_new [2]: https://rust-lang.github.io/rust-clippy/master/index.html#/unconditional_recursion [3]: rust-lang/rust-clippy#12133 [4]: rust-lang/rust-clippy#12137 Signed-off-by: Michael Weiss <michael.weiss@eviden.com>
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
Summary
Not the same as #12052. This happens with a nightly in which the other false positive is fixed already.
Lint Name
unconditional_recursion
Reproducer
Version
Additional Labels
@GuillaumeGomez @xFrednet
The text was updated successfully, but these errors were encountered: