-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Stack overflow fix #10081
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
Stack overflow fix #10081
Conversation
Fixes rust-lang#10041. Prevent recusion into Self when it's a generic parameter. Added regression test from example in rust-lang#10041.
r? @Jarcho (rustbot has picked a reviewer for you, use r? to override) |
This includes #10068 + the changes mentioned in #10068 (comment) which I have authored @nbdd0121 :) |
@bors try |
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)>
💔 Test failed - checks-action_test |
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`.
eecec91
to
f613ad9
Compare
I only replaced half of the recursion, oops :D |
@bors try |
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)>
error: methods called `new` usually return `Self` | ||
--> $DIR/methods.rs:96:5 | ||
| | ||
LL | / async fn new() -> Option<Self> { | ||
LL | | None | ||
LL | | } | ||
| |_____^ | ||
| | ||
= note: `-D clippy::new-ret-no-self` implied by `-D warnings` | ||
|
||
error: methods called `new` usually return `Self` | ||
--> $DIR/methods.rs:104:5 | ||
| | ||
LL | / fn new() -> i32 { | ||
LL | | 0 | ||
LL | | } | ||
| |_____^ | ||
| | ||
= note: `-D clippy::new-ret-no-self` implied by `-D warnings` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need some extra code to avoid FPs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this looks like a fp to me but haven't figured out yet how to work around that
☀️ Try build successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
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.
.stderr
file)cargo test
passes locallycargo dev update_lints
- N/Acargo dev fmt
changelog: [
new-ret-no-self
] Fix segmentation fault caused when generic parameter defaults toSelf
and is unspecified. For example, `fn uh_oh(&self)>