]> 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 22ba97b91df12c931cdc6d7738b76835461c0a84..996a01d413cbc1f03c0867cc7b32ac2e611171bb 100644 (file)
@@ -5,26 +5,23 @@
 /// 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 `?`"
+#[rustc_on_unimplemented(
+    on(
+        all(
+            any(from_method = "from_error", from_method = "from_ok"),
+            from_desugaring = "QuestionMark"
         ),
-        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}`"
-        )
+        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 = "?")]