Add regression test for stack overflow in redundant_pattern_matching
This commit is contained in:
parent
344f04bea6
commit
59874f3bea
9
tests/ui/crashes/ice-7169.rs
Normal file
9
tests/ui/crashes/ice-7169.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#[derive(Default)]
|
||||
struct A<T> {
|
||||
a: Vec<A<T>>,
|
||||
b: T,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if let Ok(_) = Ok::<_, ()>(A::<String>::default()) {}
|
||||
}
|
10
tests/ui/crashes/ice-7169.stderr
Normal file
10
tests/ui/crashes/ice-7169.stderr
Normal file
@ -0,0 +1,10 @@
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/ice-7169.rs:8:12
|
||||
|
|
||||
LL | if let Ok(_) = Ok::<_, ()>(A::<String>::default()) {}
|
||||
| -------^^^^^-------------------------------------- help: try this: `if Ok::<_, ()>(A::<String>::default()).is_ok()`
|
||||
|
|
||||
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user