Skip to content

Commit 10192f4

Browse files
Rollup merge of rust-lang#137167 - martn3:reliable_f16_math-f16-erfc, r=tgross35
tests: Also gate `f16::erfc()` doctest with `reliable_f16_math` cfg In rust-lang#136324 the doctest for `f16::erf()` was gated with `reliable_f16_math`. Add the same gate on `f16::erfc()` to avoid: rust_out.71e2e529d20ea47d-cgu.0:\ (.text._ZN8rust_out4main43_doctest_main_library_std_src_f16_rs_1321_017h485f3ffe6bf2a981E+0x38): \ undefined reference to `__gnu_h2f_ieee' on MIPS (and maybe other architectures). r? tgross35
2 parents 1a7315b + f6485ff commit 10192f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/f16.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1321,12 +1321,14 @@ impl f16 {
13211321
/// ```
13221322
/// #![feature(f16)]
13231323
/// #![feature(float_erf)]
1324+
/// # #[cfg(reliable_f16_math)] {
13241325
/// let x: f16 = 0.123;
13251326
///
13261327
/// let one = x.erf() + x.erfc();
13271328
/// let abs_difference = (one - 1.0).abs();
13281329
///
13291330
/// assert!(abs_difference <= f16::EPSILON);
1331+
/// # }
13301332
/// ```
13311333
#[rustc_allow_incoherent_impl]
13321334
#[must_use = "method returns a new number and does not mutate the original value"]

0 commit comments

Comments
 (0)