summary refs log tree commit diff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-11-09 07:23:57 +0100
committerest31 <MTest31@outlook.com>2016-11-09 08:37:05 +0100
commit1e9aad752beb789df4f2232adf6b9a24efbdac8d (patch)
tree0ac45e0524f65cc3186c11d0e565eaba7a558f38 /src/doc/reference.md
parentecd79a125b333e2e38fa1e0f6156438659c283db (diff)
downloadrust-1e9aad752beb789df4f2232adf6b9a24efbdac8d.tar.gz
rust-1e9aad752beb789df4f2232adf6b9a24efbdac8d.zip
Document the question mark operator
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index 4838ecd2d42..eb3a6c0de6d 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -2860,8 +2860,8 @@ assert_eq!(x, y);
 
 ### Unary operator expressions
 
-Rust defines the following unary operators. They are all written as prefix operators,
-before the expression they apply to.
+Rust defines the following unary operators. With the exception of `?`, they are
+all written as prefix operators, before the expression they apply to.
 
 * `-`
   : Negation. Signed integer types and floating-point types support negation. It
@@ -2890,6 +2890,10 @@ before the expression they apply to.
     If the `&` or `&mut` operators are applied to an rvalue, a
     temporary value is created; the lifetime of this temporary value
     is defined by [syntactic rules](#temporary-lifetimes).
+* `?`
+  : Propagating errors if applied to `Err(_)` and unwrapping if
+    applied to `Ok(_)`. Only works on the `Result<T, E>` type,
+    and written in postfix notation.
 
 ### Binary operator expressions