Skip to content

Commit a5f3b1e

Browse files
committed
Make std/src/num mirror core/src/num
The float modules in `std` are currently top-level but for `core`, they are nested within the `num` directory and referenced by `#[path = ...]`. For consistency, adjust `std` to use the same structure as `core`. Also change the `f16` and `f128` gates from outer attributes to inner attributes like `core` has.
1 parent 8afd710 commit a5f3b1e

File tree

6 files changed

+8
-2
lines changed

6 files changed

+8
-2
lines changed

library/std/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,13 @@ pub use alloc_crate::string;
585585
#[stable(feature = "rust1", since = "1.0.0")]
586586
pub use alloc_crate::vec;
587587

588-
#[unstable(feature = "f128", issue = "116909")]
588+
#[path = "num/f128.rs"]
589589
pub mod f128;
590-
#[unstable(feature = "f16", issue = "116909")]
590+
#[path = "num/f16.rs"]
591591
pub mod f16;
592+
#[path = "num/f32.rs"]
592593
pub mod f32;
594+
#[path = "num/f64.rs"]
593595
pub mod f64;
594596

595597
#[macro_use]

library/std/src/f128.rs renamed to library/std/src/num/f128.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//!
55
//! Mathematically significant numbers are provided in the `consts` sub-module.
66
7+
#![unstable(feature = "f128", issue = "116909")]
8+
79
#[unstable(feature = "f128", issue = "116909")]
810
pub use core::f128::consts;
911

library/std/src/f16.rs renamed to library/std/src/num/f16.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//!
55
//! Mathematically significant numbers are provided in the `consts` sub-module.
66
7+
#![unstable(feature = "f16", issue = "116909")]
8+
79
#[unstable(feature = "f16", issue = "116909")]
810
pub use core::f16::consts;
911

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)