From d0bc9a0ec5d948da9eabe1996660c1052f18aa3a Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Sat, 20 Jul 2024 16:45:33 +0200 Subject: [PATCH] Start using `#[diagnostic::do_not_recommend]` in the standard library This commit starts using `#[diagnostic::do_not_recommend]` in the standard library to improve some error messages. In this case we just hide a certain nightly only impl as suggested in #121521 --- core/src/lib.rs | 1 + core/src/option.rs | 1 + core/src/result.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 49f89e702558..02cb02dce1d8 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -165,6 +165,7 @@ #![feature(const_unsafecell_get_mut)] #![feature(const_waker)] #![feature(coverage_attribute)] +#![feature(do_not_recommend)] #![feature(duration_consts_float)] #![feature(internal_impls_macro)] #![feature(ip)] diff --git a/core/src/option.rs b/core/src/option.rs index 1a8fe1e6051a..d93cb8d10e60 100644 --- a/core/src/option.rs +++ b/core/src/option.rs @@ -2507,6 +2507,7 @@ impl ops::FromResidual for Option { } } +#[diagnostic::do_not_recommend] #[unstable(feature = "try_trait_v2_yeet", issue = "96374")] impl ops::FromResidual> for Option { #[inline] diff --git a/core/src/result.rs b/core/src/result.rs index f8cdcc000c50..7f278296b7b8 100644 --- a/core/src/result.rs +++ b/core/src/result.rs @@ -1990,7 +1990,7 @@ impl> ops::FromResidual> for Res } } } - +#[diagnostic::do_not_recommend] #[unstable(feature = "try_trait_v2_yeet", issue = "96374")] impl> ops::FromResidual> for Result { #[inline]