about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-14 13:51:29 +0000
committerbors <bors@rust-lang.org>2014-07-14 13:51:29 +0000
commit4e2da7cb79143b0e7206a684629ed942599ec8e9 (patch)
treee92ca202398aba259f64865ec09db37b13b5dfd3
parent996263a01589c5d2bd2a5ad559abac267296ad71 (diff)
parentded48c5847b57262eb831c5d4201761b6bf36b3f (diff)
auto merge of #15632 : masklinn/rust/patch-1, r=alexcrichton
I saw that it was bounded by `Show` but the implication is no guarantee (and had only 0.10 to test, where this behavior has been added to 0.11)
-rw-r--r--src/libcore/result.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index 32e1d570be3..980a9c7506f 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -536,7 +536,10 @@ impl<T, E> Result<T, E> {
 impl<T, E: Show> Result<T, E> {
     /// Unwraps a result, yielding the content of an `Ok`.
     ///
-    /// Fails if the value is an `Err`.
+    /// # Failure
+    ///
+    /// Fails if the value is an `Err`, with a custom failure message provided
+    /// by the `Err`'s value.
     #[inline]
     pub fn unwrap(self) -> T {
         match self {
@@ -550,7 +553,10 @@ impl<T, E: Show> Result<T, E> {
 impl<T: Show, E> Result<T, E> {
     /// Unwraps a result, yielding the content of an `Err`.
     ///
-    /// Fails if the value is an `Ok`.
+    /// # Failure
+    ///
+    /// Fails if the value is an `Ok`, with a custom failure message provided
+    /// by the `Ok`'s value.
     #[inline]
     pub fn unwrap_err(self) -> E {
         match self {