-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no method named "fract" found for type "f64" in the current scope
when in no_std
#133579
Comments
|
This is when running |
Triage: I think |
EDIT: Irrelevant, I tought I found something possibly related, but I was wrong. |
i saw a change in behavior between 1.82 and 1.83 though |
The example in the OP also fails on Rust 1.82.0: godbolt link. Can you provide an example of the behavior change you saw between 1.82.0 and 1.83.0? |
weird, i reverted back to 1.82 and i does error. did i never run cargo check on that code while on 1.82 to notice? and when compiling the tests, since the tests are not what are the alternatives for those methods in |
running a example that has |
the examples don't have tests, but they compile normally, the |
Given this project source (created using project sourcef64-thing/
├── Cargo.lock
├── Cargo.toml
├── examples
│ └── hello.rs
└── src
└── lib.rs // lib.rs
#![no_std]
pub fn fract(f: f64) -> f64 {
f.fract()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = fract(2.5);
assert_eq!(result, 0.5);
}
} // examples/hello.rs
fn main() {}
For some functions, you can use the pure-rust |
Isn't this thread just rediscovering #50145? |
Triage: AFAICT this is intentional, marking as C-discussion for now. |
I tried this code:
I expected to see this happen: Compiles successfully
Instead, this happened: Fails to compile with
E0599
"no method namedfract
found for typef64
in the current scope"Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: