Add rustc_on_unimplemented message to std::ops::Try

This commit is contained in:
Esteban Küber
2017-06-30 17:11:12 -07:00
parent 8cab2c73d4
commit d71caadee2
3 changed files with 29 additions and 0 deletions

View File

@@ -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")]