You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: no method named `ln` found for type `_` in the current scope
--> <anon>:2:18
2 |> let _ = 42.0.ln();
|> ^^
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 rand::FloatMath`
error: aborting due to previous error
The fact that unsuffixed floating-point numbers don’t currently default to f64 has already been discussed in #24124. The point of this issue is the error message: it suggests using rand::FloatMath, which is confusing as it’s an internal crate.
Regards,
Ivan
The text was updated successfully, but these errors were encountered:
I just got bitten by this one too. The fix is easy (just throw in an as f64), but the fact that you are told you don't have the trait in scope and are told to use an internal crate which is named the same as an external one is super confusing.
Luckily after doing some digging through rand's docs a bit of googling led me to this issue, but it would be really nice if this issue was fixed so others don't have to deal with it.
The following code:
produces the following error:
The fact that unsuffixed floating-point numbers don’t currently default to
f64
has already been discussed in #24124. The point of this issue is the error message: it suggests usingrand::FloatMath
, which is confusing as it’s an internal crate.Regards,
Ivan
The text was updated successfully, but these errors were encountered: