We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent efd3733 commit f9cc5a6Copy full SHA for f9cc5a6
src/librustc_typeck/check/_match.rs
@@ -615,6 +615,8 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
615
// `if` expression. E.g. given `fn foo() -> &bool;` we reject `if foo() { .. }`.
616
//
617
// 2. By expecting `bool` for `expr` we get nice diagnostics for e.g. `if x = y { .. }`.
618
+ //
619
+ // FIXME(60707): Consider removing hack with principled solution.
620
self.check_expr_has_type_or_error(discrim, self.tcx.types.bool)
621
} else {
622
self.demand_discriminant_type(arms, discrim)
0 commit comments