Auto merge of #12700 - Luv-Ray:overly_complex_bool_expr, r=Jarcho
[`overly_complex_bool_expr`]: Fix trigger wrongly on never type fixes #12689 --- changelog: fix [`overly_complex_bool_expr`] triggers wrongly on never type
This commit is contained in:
commit
1105e9debe
3 changed files with 25 additions and 0 deletions
|
|
@ -251,6 +251,11 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
|
|||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
if self.cx.typeck_results().expr_ty(e).is_never() {
|
||||
return Err("contains never type".to_owned());
|
||||
}
|
||||
|
||||
for (n, expr) in self.terminals.iter().enumerate() {
|
||||
if eq_expr_value(self.cx, e, expr) {
|
||||
#[expect(clippy::cast_possible_truncation)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue