We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 344f04b commit 59874f3Copy full SHA for 59874f3
tests/ui/crashes/ice-7169.rs
@@ -0,0 +1,9 @@
1
+#[derive(Default)]
2
+struct A<T> {
3
+ a: Vec<A<T>>,
4
+ b: T,
5
+}
6
+
7
+fn main() {
8
+ if let Ok(_) = Ok::<_, ()>(A::<String>::default()) {}
9
tests/ui/crashes/ice-7169.stderr
@@ -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
10
0 commit comments