Skip to content

Commit db7bc6b

Browse files
committed
Place radian lints under suboptimal_flops
1 parent f559682 commit db7bc6b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clippy_lints/src/floating_point_arithmetic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
651651
{
652652
span_lint_and_sugg(
653653
cx,
654-
IMPRECISE_FLOPS,
654+
SUBOPTIMAL_FLOPS,
655655
expr.span,
656656
"conversion to degrees can be done more accurately",
657657
"consider using",
@@ -664,7 +664,7 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
664664
{
665665
span_lint_and_sugg(
666666
cx,
667-
IMPRECISE_FLOPS,
667+
SUBOPTIMAL_FLOPS,
668668
expr.span,
669669
"conversion to radians can be done more accurately",
670670
"consider using",

tests/ui/floating_point_rad.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![warn(clippy::imprecise_flops)]
2+
#![warn(clippy::suboptimal_flops)]
33

44
fn main() {
55
let x = 3f32;

tests/ui/floating_point_rad.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![warn(clippy::imprecise_flops)]
2+
#![warn(clippy::suboptimal_flops)]
33

44
fn main() {
55
let x = 3f32;

tests/ui/floating_point_rad.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: conversion to degrees can be done more accurately
44
LL | let _ = x * 180f32 / std::f32::consts::PI;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.to_degrees()`
66
|
7-
= note: `-D clippy::imprecise-flops` implied by `-D warnings`
7+
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
88

99
error: conversion to radians can be done more accurately
1010
--> $DIR/floating_point_rad.rs:7:13

0 commit comments

Comments
 (0)