]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/ops/try.rs
parser: move `ban_async_in_2015` to `fn` parsing & improve it.
[rust.git] / src / libcore / ops / try.rs
index a748ee87ef99aa7ff915a872092522b2a7c35d33..996a01d413cbc1f03c0867cc7b32ac2e611171bb 100644 (file)
@@ -5,20 +5,25 @@
 /// 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(not(bootstrap), rustc_on_unimplemented(
-on(all(
-any(from_method="from_error", from_method="from_ok"),
-from_desugaring="QuestionMark"),
-message="the `?` operator can only be used in {ItemContext} \
-               that returns `Result` or `Option` \
-               (or another type that implements `{Try}`)",
-label="cannot use the `?` operator in {ItemContext} that returns `{Self}`",
-enclosing_scope="this function should return `Result` or `Option` to accept `?`"),
-on(all(from_method="into_result", from_desugaring="QuestionMark"),
-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 = "QuestionMark"
+        ),
+        message = "the `?` operator can only be used in {ItemContext} \
+                    that returns `Result` or `Option` \
+                    (or another type that implements `{Try}`)",
+        label = "cannot use the `?` operator in {ItemContext} that returns `{Self}`",
+        enclosing_scope = "this function should return `Result` or `Option` to accept `?`"
+    ),
+    on(
+        all(from_method = "into_result", from_desugaring = "QuestionMark"),
+        message = "the `?` operator can only be applied to values \
+                    that implement `{Try}`",
+        label = "the `?` operator cannot be applied to type `{Self}`"
+    )
+)]
 #[doc(alias = "?")]
 pub trait Try {
     /// The type of this value when viewed as successful.