about summary refs log tree commit diff
path: root/src/libcore/ops
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-03-30 01:31:13 +0200
committerGitHub <noreply@github.com>2018-03-30 01:31:13 +0200
commitd06abdbfd8ddedddb384ed155315275d87d34ecf (patch)
tree7cd1399eab94ca90fe0c80d9ea588e3e6ef5cd8e /src/libcore/ops
parenteb3e2feb0d2de2b9e54a51216f0c53c7962cfc10 (diff)
parent1f143bc46fe04aa564736b4741a8f179c46eccc5 (diff)
downloadrust-d06abdbfd8ddedddb384ed155315275d87d34ecf.tar.gz
rust-d06abdbfd8ddedddb384ed155315275d87d34ecf.zip
Rollup merge of #49446 - frewsxcv:frewsxcv-mention-optiono, r=GuillaumeGomez
Explicitly mention `Option` in `?` error message.

Save users the time/effort of having to lookup what types implement
the `Try` trait.
Diffstat (limited to 'src/libcore/ops')
-rw-r--r--src/libcore/ops/try.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs
index 81e5cb5c350..ef6a8fb6a61 100644
--- a/src/libcore/ops/try.rs
+++ b/src/libcore/ops/try.rs
@@ -20,7 +20,7 @@
        any(from_method="from_error", from_method="from_ok"),
        from_desugaring="?"),
       message="the `?` operator can only be used in a \
-               function that returns `Result` \
+               function that returns `Result` or `Option` \
                (or another type that implements `{Try}`)",
       label="cannot use the `?` operator in a function that returns `{Self}`"),
    on(all(from_method="into_result", from_desugaring="?"),