Skip to content

Commit 0a5d5ff

Browse files
committed
Change f16 doctests in core to run on x86-64
Since `f16` now works on x86 and x86-64, change doctests to use this instead of aarch64. This is to make sure any changes get run in PR CI.
1 parent e518451 commit 0a5d5ff

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

library/core/src/num/f16.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl f16 {
261261
///
262262
/// ```
263263
/// #![feature(f16)]
264-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
264+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
265265
///
266266
/// let nan = f16::NAN;
267267
/// let f = 7.0_f16;
@@ -293,7 +293,7 @@ impl f16 {
293293
///
294294
/// ```
295295
/// #![feature(f16)]
296-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
296+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
297297
///
298298
/// let f = 7.0f16;
299299
/// let inf = f16::INFINITY;
@@ -319,7 +319,7 @@ impl f16 {
319319
///
320320
/// ```
321321
/// #![feature(f16)]
322-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
322+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
323323
///
324324
/// let f = 7.0f16;
325325
/// let inf: f16 = f16::INFINITY;
@@ -347,7 +347,7 @@ impl f16 {
347347
///
348348
/// ```
349349
/// #![feature(f16)]
350-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
350+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
351351
///
352352
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
353353
/// let max = f16::MAX;
@@ -377,7 +377,7 @@ impl f16 {
377377
///
378378
/// ```
379379
/// #![feature(f16)]
380-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
380+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
381381
///
382382
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
383383
/// let max = f16::MAX;
@@ -409,7 +409,7 @@ impl f16 {
409409
///
410410
/// ```
411411
/// #![feature(f16)]
412-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
412+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
413413
///
414414
/// use std::num::FpCategory;
415415
///
@@ -725,7 +725,7 @@ impl f16 {
725725
///
726726
/// ```
727727
/// #![feature(f16)]
728-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
728+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
729729
///
730730
/// let value = 4.6_f16;
731731
/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
@@ -768,7 +768,7 @@ impl f16 {
768768
///
769769
/// ```
770770
/// #![feature(f16)]
771-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
771+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
772772
///
773773
/// # // FIXME(f16_f128): enable this once const casting works
774774
/// # // assert_ne!((1f16).to_bits(), 1f16 as u128); // to_bits() is not casting!
@@ -857,7 +857,7 @@ impl f16 {
857857
///
858858
/// ```
859859
/// #![feature(f16)]
860-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
860+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
861861
///
862862
/// let v = f16::from_bits(0x4a40);
863863
/// assert_eq!(v, 12.5);
@@ -1011,7 +1011,7 @@ impl f16 {
10111011
///
10121012
/// ```
10131013
/// #![feature(f16)]
1014-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1014+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10151015
///
10161016
/// let value = f16::from_be_bytes([0x4a, 0x40]);
10171017
/// assert_eq!(value, 12.5);
@@ -1034,7 +1034,7 @@ impl f16 {
10341034
///
10351035
/// ```
10361036
/// #![feature(f16)]
1037-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1037+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10381038
///
10391039
/// let value = f16::from_le_bytes([0x40, 0x4a]);
10401040
/// assert_eq!(value, 12.5);
@@ -1064,7 +1064,7 @@ impl f16 {
10641064
///
10651065
/// ```
10661066
/// #![feature(f16)]
1067-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1067+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10681068
///
10691069
/// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
10701070
/// [0x4a, 0x40]
@@ -1197,7 +1197,7 @@ impl f16 {
11971197
///
11981198
/// ```
11991199
/// #![feature(f16)]
1200-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1200+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
12011201
///
12021202
/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
12031203
/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);

0 commit comments

Comments
 (0)