From 1d0c015f9b5e4da3695ed23f269dc51a8d09b8a9 Mon Sep 17 00:00:00 2001 From: Mikhail Babenko Date: Mon, 25 Nov 2019 00:29:40 +0300 Subject: added enclosing_scope attr to Try trait and fixed ui tests accordingly --- src/libcore/ops/try.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libcore') 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. -- cgit 1.4.1-3-g733a5 From ac57e1b64711dfdc3bd2987636ecc021707df283 Mon Sep 17 00:00:00 2001 From: cad97 Date: Sun, 1 Dec 2019 16:09:07 -0500 Subject: Remove ord lang item --- src/libcore/cmp.rs | 1 - src/librustc/middle/lang_items.rs | 1 - 2 files changed, 2 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index eea3dc39d34..a5f355cd9a7 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -534,7 +534,6 @@ impl Ord for Reverse { /// } /// } /// ``` -#[lang = "ord"] #[doc(alias = "<")] #[doc(alias = ">")] #[doc(alias = "<=")] diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index f6cd9b1c7ec..6f7a022eccf 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -358,7 +358,6 @@ language_item_table! { // Don't be fooled by the naming here: this lang item denotes `PartialEq`, not `Eq`. EqTraitLangItem, "eq", eq_trait, Target::Trait; PartialOrdTraitLangItem, "partial_ord", partial_ord_trait, Target::Trait; - OrdTraitLangItem, "ord", ord_trait, Target::Trait; // A number of panic-related lang items. The `panic` item corresponds to // divide-by-zero and various panic cases with `match`. The -- cgit 1.4.1-3-g733a5