Skip to content

Commit

Permalink
Start using #[diagnostic::do_not_recommend] in the standard library
Browse files Browse the repository at this point in the history
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
  • Loading branch information
weiznich committed Jul 22, 2024
1 parent 2b62867 commit d0bc9a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 1 addition & 0 deletions core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,7 @@ impl<T> ops::FromResidual for Option<T> {
}
}

#[diagnostic::do_not_recommend]
#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
impl<T> ops::FromResidual<ops::Yeet<()>> for Option<T> {
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Res
}
}
}

#[diagnostic::do_not_recommend]
#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]
impl<T, E, F: From<E>> ops::FromResidual<ops::Yeet<E>> for Result<T, F> {
#[inline]
Expand Down

0 comments on commit d0bc9a0

Please sign in to comment.