Skip to content

Stack overflow in redundant_pattern_matching #7169

Closed
@flip1995

Description

@flip1995

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.

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️P-highPriority: High

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions