Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7ae76f0

Browse files
authoredJul 22, 2024
Rollup merge of rust-lang#128008 - weiznich:fix/121521, r=lcnr
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 The result in not perfect yet, but at least the `Yeet` suggestion is not shown anymore. I would consider that as a minor improvement.
2 parents 323e962 + d0bc9a0 commit 7ae76f0

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)
Failed to load comments.