Closed
Description
#![crate_type="lib"]
#![no_std]
fn f(x: f32) -> f32 { x.abs() }
error: no method named `abs` found for type `f32` in the current scope
--> <anon>:3:25
|>
3 |> fn f(x: f32) -> f32 { x.abs() }
|> ^^^
help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
help: candidate #1: `use core::num::Float`
It is actually possible to write core::num::Float::abs(x)
, but I'm not sure that's actually supposed to be legal, and at that point, you might as well just write your own abs() function.