diff --git a/src/doc/unstable-book/src/language-features/catch-expr.md b/src/doc/unstable-book/src/language-features/catch-expr.md index 247333d841a..5295d642aa6 100644 --- a/src/doc/unstable-book/src/language-features/catch-expr.md +++ b/src/doc/unstable-book/src/language-features/catch-expr.md @@ -6,22 +6,24 @@ The tracking issue for this feature is: [#31436] ------------------------ -The `catch_expr` feature adds support for a `catch` expression. The `catch` -expression creates a new scope one can use the `?` operator in. +The `catch_expr` feature adds support for `try` blocks. A `try` +block creates a new scope one can use the `?` operator in. + +```rust,ignore +// This code needs the 2018 edition -```rust #![feature(catch_expr)] use std::num::ParseIntError; -let result: Result = do catch { +let result: Result = try { "1".parse::()? + "2".parse::()? + "3".parse::()? }; assert_eq!(result, Ok(6)); -let result: Result = do catch { +let result: Result = try { "1".parse::()? + "foo".parse::()? + "3".parse::()?