(Placeholder(a_p), Placeholder(b_p)) => a_p == b_p,
(Infer(a_t), Infer(b_t)) => a_t == b_t,
(Error(a_e), Error(b_e)) => a_e == b_e,
- _ => true, // unreachable
+ (Bool, Bool) | (Char, Char) | (Str, Str) | (Never, Never) => true,
+ _ => {
+ debug_assert!(
+ false,
+ "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}"
+ );
+ true
+ }
}
}
}
(Placeholder(a_p), Placeholder(b_p)) => a_p.cmp(b_p),
(Infer(a_t), Infer(b_t)) => a_t.cmp(b_t),
(Error(a_e), Error(b_e)) => a_e.cmp(b_e),
- _ => Ordering::Equal, // unreachable
+ (Bool, Bool) | (Char, Char) | (Str, Str) | (Never, Never) => Ordering::Equal,
+ _ => {
+ debug_assert!(false, "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}");
+ Ordering::Equal
+ }
}
})
}
(ReVar(a_r), ReVar(b_r)) => a_r == b_r,
(RePlaceholder(a_r), RePlaceholder(b_r)) => a_r == b_r,
(ReErased, ReErased) => true,
- _ => true, // unreachable
+ _ => {
+ debug_assert!(
+ false,
+ "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}"
+ );
+ true
+ }
}
}
}
(ReVar(a_r), ReVar(b_r)) => a_r.cmp(b_r),
(RePlaceholder(a_r), RePlaceholder(b_r)) => a_r.cmp(b_r),
(ReErased, ReErased) => Ordering::Equal,
- _ => Ordering::Equal, // unreachable
+ _ => {
+ debug_assert!(false, "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}");
+ Ordering::Equal
+ }
}
})
}