about summary refs log tree commit diff
path: root/src/libcore/ops
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-06-30 17:11:12 -0700
committerEsteban Küber <esteban@kuber.com.ar>2017-07-05 22:28:35 -0700
commitd71caadee22f5a6cd1b16a8c6978efd4135707d0 (patch)
treee405f7f77c23d183d3c1e1077cd6bbaab1721010 /src/libcore/ops
parent8cab2c73d47a4b0ec7dc1bf40eb59492139fb707 (diff)
Add `rustc_on_unimplemented` message to `std::ops::Try`
Diffstat (limited to 'src/libcore/ops')
-rw-r--r--src/libcore/ops/try.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs
index 2f0639d1a60..9da9879d38a 100644
--- a/src/libcore/ops/try.rs
+++ b/src/libcore/ops/try.rs
@@ -15,6 +15,8 @@
 /// extracting those success or failure values from an existing instance and
 /// creating a new instance from a success or failure value.
 #[unstable(feature = "try_trait", issue = "42327")]
+#[rustc_on_unimplemented = "the `?` operator can only be used in a function that returns `Result` \
+                            (or another type that implements `std::ops::Try`)"]
 pub trait Try {
     /// The type of this value when viewed as successful.
     #[unstable(feature = "try_trait", issue = "42327")]