about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMikhail Babenko <misha-babenko@yandex.ru>2019-11-25 00:29:40 +0300
committerMikhail Babenko <misha-babenko@yandex.ru>2019-11-25 18:10:14 +0300
commit1d0c015f9b5e4da3695ed23f269dc51a8d09b8a9 (patch)
tree8198a7b2eb7204efee10a573ae2c516e229ddbc7 /src/libcore
parent45aadf7ae627752dd7c0e8709fa8ff592c2d075e (diff)
added enclosing_scope attr to Try trait and fixed ui tests accordingly
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ops/try.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/ops/try.rs b/src/libcore/ops/try.rs
index 4f4652084a8..a748ee87ef9 100644
--- a/src/libcore/ops/try.rs
+++ b/src/libcore/ops/try.rs
@@ -5,19 +5,20 @@
 /// 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(
+#[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}`"),
+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.