From 1f143bc46fe04aa564736b4741a8f179c46eccc5 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Wed, 28 Mar 2018 11:25:52 +0200 Subject: Explicitly mention `Option` in `?` error message. Save users the time/effort of having to lookup what types implement the `Try` trait. --- src/libcore/ops/try.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcore') 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="?"), -- cgit 1.4.1-3-g733a5