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

Stack overflow in redundant_pattern_matching #7169

Closed
flip1995 opened this issue May 5, 2021 · 1 comment · Fixed by #7170
Closed

Stack overflow in redundant_pattern_matching #7169

flip1995 opened this issue May 5, 2021 · 1 comment · Fixed by #7170
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ P-high Priority: High

Comments

@flip1995
Copy link
Member

flip1995 commented May 5, 2021

This was found by @llogiq appearing on https://github.com/openquery-io/synth.

This is probably caused by #6568. I still have to verify. If so, I'll revert this commit and backport the revert to beta.

Code

#[derive(Default)]
struct A<T> {
    a: Vec<A<T>>,
    b: T,
}

fn main() {
    if let Ok(_) = Ok::<_, ()>(A::<String>::default()) { }
}

Playground

Meta

  • cargo clippy -V: clippy 0.1.53 (42816d6 2021-04-24)
  • rustc -Vv:
rustc 1.53.0-nightly (42816d61e 2021-04-24)
binary: rustc
commit-hash: 42816d61ead7e46d462df997958ccfd514f8c21c
commit-date: 2021-04-24
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow

No backtrace.

@flip1995 flip1995 added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ P-high Priority: High I-sync-blocker Issue: Prevents a change to be synced to rust-lang/rust labels May 5, 2021
@flip1995
Copy link
Member Author

flip1995 commented May 5, 2021

@rustbot claim

@bors bors closed this as completed in 182a185 May 5, 2021
@bors bors closed this as completed in #7170 May 5, 2021
@flip1995 flip1995 removed the I-sync-blocker Issue: Prevents a change to be synced to rust-lang/rust label May 5, 2021
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue May 10, 2021
Fix stack overflow issue in `redundant_pattern_matching`

Fixes rust-lang#7169

~~cc `@Jarcho` Since tomorrow is release day and we need to get this also fixed in beta, I'll just revert the PR instead of looking into the root issue. Your changes are good, so if you have an idea what could cause this stack overflow and know how to fix it, please open a PR that reverts this revert with a fix.~~

r? `@llogiq`

changelog: none (fixes stack overflow, but this was introduced in this release cycle)
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 8, 2021
…lacrum

[Beta] Backport ICE fix in Clippy

This backports an ICE / stack overflow fix from rust-lang/rust-clippy#7170.

cc rust-lang/rust-clippy#7169

cc `@llogiq` `@camsteffen`

r? `@Mark-Simulacrum`
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-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ P-high Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant