## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Error code E0301

#### Note: this error code is no longer emitted by the compiler.

Mutable borrows are not allowed in pattern guards, because matching cannot have side effects. Side effects could alter the matched object or the environment on which the match depends in such a way, that the match would not be exhaustive. For instance, the following would not match any arm if mutable borrows were allowed:

    #![allow(unused)]
    fn main() {
    match Some(()) {
        None => { },
        option if option.take().is_none() => {
            /* impossible, option is `Some` */
        },
        Some(_) => { } // When the previous match failed, the option became `None`.
    }
    }