forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing parens in
suboptimal_flops
sugg
Fixes rust-lang#9391
- Loading branch information
Showing
4 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,52 @@ | ||
error: conversion to radians can be done more accurately | ||
--> $DIR/floating_point_rad.rs:12:13 | ||
| | ||
LL | let _ = degrees as f64 * std::f64::consts::PI / 180.0; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(degrees as f64).to_radians()` | ||
| | ||
= note: `-D clippy::suboptimal-flops` implied by `-D warnings` | ||
|
||
error: conversion to degrees can be done more accurately | ||
--> $DIR/floating_point_rad.rs:13:13 | ||
| | ||
LL | let _ = degrees as f64 * 180.0 / std::f64::consts::PI; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(degrees as f64).to_degrees()` | ||
|
||
error: conversion to degrees can be done more accurately | ||
--> $DIR/floating_point_rad.rs:18:13 | ||
| | ||
LL | let _ = x * 180f32 / std::f32::consts::PI; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.to_degrees()` | ||
| | ||
= note: `-D clippy::suboptimal-flops` implied by `-D warnings` | ||
|
||
error: conversion to degrees can be done more accurately | ||
--> $DIR/floating_point_rad.rs:14:13 | ||
--> $DIR/floating_point_rad.rs:19:13 | ||
| | ||
LL | let _ = 90. * 180f64 / std::f64::consts::PI; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.0_f64.to_degrees()` | ||
|
||
error: conversion to degrees can be done more accurately | ||
--> $DIR/floating_point_rad.rs:15:13 | ||
--> $DIR/floating_point_rad.rs:20:13 | ||
| | ||
LL | let _ = 90.5 * 180f64 / std::f64::consts::PI; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.5_f64.to_degrees()` | ||
|
||
error: conversion to radians can be done more accurately | ||
--> $DIR/floating_point_rad.rs:16:13 | ||
--> $DIR/floating_point_rad.rs:21:13 | ||
| | ||
LL | let _ = x * std::f32::consts::PI / 180f32; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.to_radians()` | ||
|
||
error: conversion to radians can be done more accurately | ||
--> $DIR/floating_point_rad.rs:17:13 | ||
--> $DIR/floating_point_rad.rs:22:13 | ||
| | ||
LL | let _ = 90. * std::f32::consts::PI / 180f32; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.0_f64.to_radians()` | ||
|
||
error: conversion to radians can be done more accurately | ||
--> $DIR/floating_point_rad.rs:18:13 | ||
--> $DIR/floating_point_rad.rs:23:13 | ||
| | ||
LL | let _ = 90.5 * std::f32::consts::PI / 180f32; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.5_f64.to_radians()` | ||
|
||
error: aborting due to 6 previous errors | ||
error: aborting due to 8 previous errors | ||
|