You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document the question mark operator in reference and the book's syntax index
The question mark operator will be stabilized for the Rust 1.13 release (unfortunately). Even though I don't like the operator, it still should be documented in the syntax index in the book and in the reference.
Maybe there are people who also want to change the book's chapters on error handling, depending on their views of what idiomatic error handling is, now that the operator is stable, but I don't want to and I'd prefer to keep this PR focused on the reference and syntax index only.
Please also apply this PR to the beta branch of rust.
Copy file name to clipboardExpand all lines: src/doc/book/syntax-index.md
+2
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,7 @@
94
94
*`|=` (`var |= expr`): bitwise or & assignment. Overloadable (`BitOrAssign`).
95
95
*`||` (`expr || expr`): logical or.
96
96
*`_`: "ignored" pattern binding (see [Patterns (Ignoring bindings)]). Also used to make integer-literals readable (see [Reference (Integer literals)]).
97
+
*`?` (`expr?`): Error propagation. Returns early when `Err(_)` is encountered, unwraps otherwise. Similar to the [`try!` macro].
0 commit comments