Slightly misleading error message when passing a negative float into Duration::from_secs_f32 #89913
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f974e7cf48544a6625e0ff9e11af9a76
The current output is:
Ideally the output should look like:
while the current error message might still give a hint as to what could be going on, if you have genuinely large numbers passed to the function, you may go in a completely wrong path while debugging (testing the input to be within limits, rather than checking if it is negative or not).
The text was updated successfully, but these errors were encountered: