Skip to content

De-duplicate f16 & f128 doctest attributes #142192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions library/core/src/num/f128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,7 @@ impl f128 {
// due to https://github.com/llvm/llvm-project/issues/44744. aarch64 linux matches this.
// #[unstable(feature = "core_float_math", issue = "137578")]
#[cfg(not(test))]
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), expect(internal_features))))]
impl f128 {
/// Returns the largest integer less than or equal to `self`.
///
Expand All @@ -1431,8 +1432,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1464,8 +1463,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1497,8 +1494,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1535,8 +1530,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1570,8 +1563,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1604,8 +1595,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1646,8 +1635,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1694,8 +1681,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1739,8 +1724,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1779,8 +1762,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down Expand Up @@ -1814,8 +1795,6 @@ impl f128 {
///
/// ```
/// #![feature(f128)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f128_math)] {
///
Expand Down
25 changes: 1 addition & 24 deletions library/core/src/num/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,7 @@ impl f16 {
// Functions in this module fall into `core_float_math`
// #[unstable(feature = "core_float_math", issue = "137578")]
#[cfg(not(test))]
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), expect(internal_features))))]
impl f16 {
/// Returns the largest integer less than or equal to `self`.
///
Expand All @@ -1407,8 +1408,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1440,8 +1439,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1473,8 +1470,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1511,8 +1506,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1546,8 +1539,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1580,8 +1571,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1622,8 +1611,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1670,8 +1657,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1715,8 +1700,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1755,8 +1738,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1790,8 +1771,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down Expand Up @@ -1828,8 +1807,6 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #![feature(cfg_target_has_reliable_f16_f128)]
/// # #![expect(internal_features)]
/// # #[cfg(not(miri))]
/// # #[cfg(target_has_reliable_f16_math)] {
///
Expand Down
Loading
Loading