-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
f64::copysign claims support since 1.35.0 in core #147593
Copy link
Copy link
Open
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Location (URL)
https://doc.rust-lang.org/core/primitive.f64.html#method.copysign
Summary
#131304 added
f64::copysigntocorewhich is long after1.35.0. The following code using the much newercargo 1.76.0in ano_stdenvironment causes a compilation failure:[zack@laptop src]$ cargo -V cargo 1.76.0 (c84b36747 2024-01-18) [zack@laptop src]$ cargo check Checking water v0.1.0 (/home/zack/projects/water) error[E0599]: no method named `copysign` found for type `f64` in the current scope --> src/lib.rs:3:14 | 3 | _ = 0f64.copysign(0f64); | ^^^^^^^^ method not found in `f64` For more information about this error, try `rustc --explain E0599`. error: could not compile `water` (lib) due to 1 previous errorCommenting out
#![no_std]fixes the problem showing that while the method was defined instdsince1.35.0, it wasn't added tocoreuntil far later:[zack@laptop src]$ cargo check Checking water v0.1.0 (/home/zack/projects/water) warning: function `example` is never used --> src/lib.rs:2:4 | 2 | fn example() { | ^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: `water` (lib) generated 1 warning Finished dev [unoptimized + debuginfo] target(s) in 0.03s