Skip to content

Commit d0bc9a0

Browse files
committed
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 rust-lang#121521
1 parent 2b62867 commit d0bc9a0

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
#![feature(const_unsafecell_get_mut)]
166166
#![feature(const_waker)]
167167
#![feature(coverage_attribute)]
168+
#![feature(do_not_recommend)]
168169
#![feature(duration_consts_float)]
169170
#![feature(internal_impls_macro)]
170171
#![feature(ip)]

core/src/option.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,7 @@ impl<T> ops::FromResidual for Option<T> {
25072507
}
25082508
}
25092509

2510+
#[diagnostic::do_not_recommend]
25102511
#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
25112512
impl<T> ops::FromResidual<ops::Yeet<()>> for Option<T> {
25122513
#[inline]

core/src/result.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Res
19901990
}
19911991
}
19921992
}
1993-
1993+
#[diagnostic::do_not_recommend]
19941994
#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
19951995
impl<T, E, F: From<E>> ops::FromResidual<ops::Yeet<E>> for Result<T, F> {
19961996
#[inline]

0 commit comments

Comments
 (0)