about summary refs log tree commit diff
path: root/src/libcore/ops
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/ops')
-rw-r--r--src/libcore/ops/try.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs
index 6e330f538a8..28e84d2fba6 100644
--- a/src/libcore/ops/try.rs
+++ b/src/libcore/ops/try.rs
@@ -21,7 +21,9 @@
                                      (or another type that implements `{Try}`)")]
 #[cfg_attr(not(stage0),
            rustc_on_unimplemented(
-               on(all(direct, from_desugaring="?"),
+               on(all(
+                   any(from_method="from_error", from_method="from_ok"),
+                   from_desugaring="?"),
                   message="the `?` operator can only be used in a \
                            function that returns `Result` \
                            (or another type that implements `{Try}`)",