diff options
Diffstat (limited to 'src/libcore/ops/try.rs')
| -rw-r--r-- | src/libcore/ops/try.rs | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs index e788b66a1ec..81e5cb5c350 100644 --- a/src/libcore/ops/try.rs +++ b/src/libcore/ops/try.rs @@ -15,24 +15,19 @@ /// 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")] -#[cfg_attr(stage0, - rustc_on_unimplemented = "the `?` operator can only be used in a \ - function that returns `Result` \ - (or another type that implements `{Try}`)")] -#[cfg_attr(not(stage0), - rustc_on_unimplemented( - 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}`)", - label="cannot use the `?` operator in a function that returns `{Self}`"), - on(all(from_method="into_result", from_desugaring="?"), - message="the `?` operator can only be applied to values \ - that implement `{Try}`", - label="the `?` operator cannot be applied to type `{Self}`") -))] +#[rustc_on_unimplemented( + 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}`)", + label="cannot use the `?` operator in a function that returns `{Self}`"), + on(all(from_method="into_result", from_desugaring="?"), + message="the `?` operator can only be applied to values \ + that implement `{Try}`", + label="the `?` operator cannot be applied to type `{Self}`") +)] pub trait Try { /// The type of this value when viewed as successful. #[unstable(feature = "try_trait", issue = "42327")] |
