-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clippy crashes on simple method returning impl PartialOrd
#10041
Comments
impl Trait
impl PartialOrd
We believe that this is because |
Nominating for the next meeting; is this something we want to fix and beta backport? As far as I understand this will make it into the imminent master -> beta promition. |
Fixes rust-lang#10041. Prevent recusion into Self when it's a generic parameter. Added regression test from example in rust-lang#10041.
Sorry for the trouble, just saw this today (as I wasn't cc'ed in this issue). Yes your analysis is correct, this is caused by recursive |
Fixes rust-lang#10041. Prevent recusion into Self when it's a generic parameter. Added regression test from example in rust-lang#10041.
See rust-lang#10068 (comment) for details -- original PR description of rust-lang#10068 -- fixes rust-lang#10041 Prevent recursion into Self when it's a generic parameter. Added regression test from example in rust-lang#10041. - \[x] Followed [lint naming conventions][lint_naming] - **N/A** - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - **N/A** - \[x] Added lint documentation - **N/A** - \[x] Run `cargo dev fmt` changelog: [`new-ret-no-self`] Fix segmentation fault caused when generic parameter defaults to `Self` and is unspecified. For example, `fn uh_oh(&self) -> impl PartialOrd { ... }` has a hidden `Rhs=Self` as the generic parameter for `PartialOrd`.
Stack overflow fix See #10068 (comment) for details -- original PR description of #10068 -- fixes #10041 Prevent recursion into Self when it's a generic parameter. Added regression test from example in #10041. - \[x] Followed [lint naming conventions][lint_naming] - **N/A** - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - **N/A** - \[x] Added lint documentation - **N/A** - \[x] Run `cargo dev fmt` changelog: [`new-ret-no-self`] Fix segmentation fault caused when generic parameter defaults to `Self` and is unspecified. For example, `fn uh_oh(&self)>
See rust-lang#10068 (comment) for details -- original PR description of rust-lang#10068 -- fixes rust-lang#10041 Prevent recursion into Self when it's a generic parameter. Added regression test from example in rust-lang#10041. - \[x] Followed [lint naming conventions][lint_naming] - **N/A** - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - **N/A** - \[x] Added lint documentation - **N/A** - \[x] Run `cargo dev fmt` changelog: [`new-ret-no-self`] Fix segmentation fault caused when generic parameter defaults to `Self` and is unspecified. For example, `fn uh_oh(&self) -> impl PartialOrd { ... }` has a hidden `Rhs=Self` as the generic parameter for `PartialOrd`.
Stack overflow fix See #10068 (comment) for details -- original PR description of #10068 -- fixes #10041 Prevent recursion into Self when it's a generic parameter. Added regression test from example in #10041. - \[x] Followed [lint naming conventions][lint_naming] - **N/A** - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - **N/A** - \[x] Added lint documentation - **N/A** - \[x] Run `cargo dev fmt` changelog: [`new-ret-no-self`] Fix segmentation fault caused when generic parameter defaults to `Self` and is unspecified. For example, `fn uh_oh(&self)>
Summary
This is probably caused by #9733 per a crash analysis:
Reproducer
I tried this code:
I expected to see this happen:
Clippy does not crash.
Instead, this happened:
Clippy crashes with a stack overflow exception.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: