yeet_expr - The Rust Unstable Book

## 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

# `yeet_expr`

The tracking issue for this feature is: #96373

The `yeet_expr` feature adds support for `do yeet` expressions, which can be used to early-exit from a function or `try` block.

These are highly experimental, thus the placeholder syntax.

    #![allow(unused)]
    #![feature(yeet_expr)]

    fn main() {
    fn foo() -> Result<String, i32> {
        do yeet 4;
    }
    assert_eq!(foo(), Err(4));

    fn bar() -> Option<String> {
        do yeet;
    }
    assert_eq!(bar(), None);
    }