diff --git a/src/pattern-matching/match-guards.md b/src/pattern-matching/match-guards.md index 5c58e83a..b61e09a9 100644 --- a/src/pattern-matching/match-guards.md +++ b/src/pattern-matching/match-guards.md @@ -6,3 +6,14 @@ expression which will be executed if the pattern matches: ```rust,editable {{#include ../../third_party/rust-by-example/match-guards.rs}} ``` + +
+ +Match guards as a separate syntax feature are important and necessary. They are not +the same as separate `if` expression inside of the match arm. + +An `if` expression inside of the branch block (after `=>`) happens after the match arm +is selected. Failing the `if` condition inside of that block won't result in other arms +of the original `match` expression being considered. + +