Skip to content

Commit bf5bb17

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 537e6db commit bf5bb17

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
@@ -267,7 +267,7 @@ impl f16 {
267267
///
268268
/// ```
269269
/// #![feature(f16)]
270-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
270+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
271271
///
272272
/// let nan = f16::NAN;
273273
/// let f = 7.0_f16;
@@ -301,7 +301,7 @@ impl f16 {
301301
///
302302
/// ```
303303
/// #![feature(f16)]
304-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
304+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
305305
///
306306
/// let f = 7.0f16;
307307
/// let inf = f16::INFINITY;
@@ -328,7 +328,7 @@ impl f16 {
328328
///
329329
/// ```
330330
/// #![feature(f16)]
331-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
331+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
332332
///
333333
/// let f = 7.0f16;
334334
/// let inf: f16 = f16::INFINITY;
@@ -357,7 +357,7 @@ impl f16 {
357357
///
358358
/// ```
359359
/// #![feature(f16)]
360-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
360+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
361361
///
362362
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
363363
/// let max = f16::MAX;
@@ -388,7 +388,7 @@ impl f16 {
388388
///
389389
/// ```
390390
/// #![feature(f16)]
391-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
391+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
392392
///
393393
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
394394
/// let max = f16::MAX;
@@ -421,7 +421,7 @@ impl f16 {
421421
///
422422
/// ```
423423
/// #![feature(f16)]
424-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
424+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
425425
///
426426
/// use std::num::FpCategory;
427427
///
@@ -744,7 +744,7 @@ impl f16 {
744744
///
745745
/// ```
746746
/// #![feature(f16)]
747-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
747+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
748748
///
749749
/// let value = 4.6_f16;
750750
/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
@@ -787,7 +787,7 @@ impl f16 {
787787
///
788788
/// ```
789789
/// #![feature(f16)]
790-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
790+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
791791
///
792792
/// # // FIXME(f16_f128): enable this once const casting works
793793
/// # // assert_ne!((1f16).to_bits(), 1f16 as u128); // to_bits() is not casting!
@@ -876,7 +876,7 @@ impl f16 {
876876
///
877877
/// ```
878878
/// #![feature(f16)]
879-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
879+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
880880
///
881881
/// let v = f16::from_bits(0x4a40);
882882
/// assert_eq!(v, 12.5);
@@ -1030,7 +1030,7 @@ impl f16 {
10301030
///
10311031
/// ```
10321032
/// #![feature(f16)]
1033-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1033+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10341034
///
10351035
/// let value = f16::from_be_bytes([0x4a, 0x40]);
10361036
/// assert_eq!(value, 12.5);
@@ -1053,7 +1053,7 @@ impl f16 {
10531053
///
10541054
/// ```
10551055
/// #![feature(f16)]
1056-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1056+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10571057
///
10581058
/// let value = f16::from_le_bytes([0x40, 0x4a]);
10591059
/// assert_eq!(value, 12.5);
@@ -1083,7 +1083,7 @@ impl f16 {
10831083
///
10841084
/// ```
10851085
/// #![feature(f16)]
1086-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1086+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10871087
///
10881088
/// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
10891089
/// [0x4a, 0x40]
@@ -1217,7 +1217,7 @@ impl f16 {
12171217
///
12181218
/// ```
12191219
/// #![feature(f16)]
1220-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1220+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
12211221
///
12221222
/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
12231223
/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);

0 commit comments

Comments
 (0)