Place radian lints under suboptimal_flops

This commit is contained in:
Thiago Arrais 2020-06-15 13:59:44 -03:00
parent f5596826fa
commit db7bc6b3bd
4 changed files with 5 additions and 5 deletions

View file

@ -651,7 +651,7 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
{
span_lint_and_sugg(
cx,
IMPRECISE_FLOPS,
SUBOPTIMAL_FLOPS,
expr.span,
"conversion to degrees can be done more accurately",
"consider using",
@ -664,7 +664,7 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
{
span_lint_and_sugg(
cx,
IMPRECISE_FLOPS,
SUBOPTIMAL_FLOPS,
expr.span,
"conversion to radians can be done more accurately",
"consider using",

View file

@ -1,5 +1,5 @@
// run-rustfix
#![warn(clippy::imprecise_flops)]
#![warn(clippy::suboptimal_flops)]
fn main() {
let x = 3f32;

View file

@ -1,5 +1,5 @@
// run-rustfix
#![warn(clippy::imprecise_flops)]
#![warn(clippy::suboptimal_flops)]
fn main() {
let x = 3f32;

View file

@ -4,7 +4,7 @@ error: conversion to degrees can be done more accurately
LL | let _ = x * 180f32 / std::f32::consts::PI;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.to_degrees()`
|
= note: `-D clippy::imprecise-flops` implied by `-D warnings`
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
error: conversion to radians can be done more accurately
--> $DIR/floating_point_rad.rs:7:13