Skip to content

Commit

Permalink
check_match: add FIXME for removing of hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed May 10, 2019
1 parent efd3733 commit f9cc5a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_typeck/check/_match.rs
Expand Up @@ -615,6 +615,8 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
// `if` expression. E.g. given `fn foo() -> &bool;` we reject `if foo() { .. }`.
//
// 2. By expecting `bool` for `expr` we get nice diagnostics for e.g. `if x = y { .. }`.
//
// FIXME(60707): Consider removing hack with principled solution.
self.check_expr_has_type_or_error(discrim, self.tcx.types.bool)
} else {
self.demand_discriminant_type(arms, discrim)
Expand Down

0 comments on commit f9cc5a6

Please sign in to comment.