@@ -732,14 +732,14 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
732
732
impl < ' tcx > LateLintPass < ' tcx > for FloatingPointArithmetic {
733
733
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
734
734
// All of these operations are currently not const and are in std.
735
- if in_constant ( cx, expr. hir_id ) || is_no_std_crate ( cx ) {
735
+ if in_constant ( cx, expr. hir_id ) {
736
736
return ;
737
737
}
738
738
739
739
if let ExprKind :: MethodCall ( path, receiver, args, _) = & expr. kind {
740
740
let recv_ty = cx. typeck_results ( ) . expr_ty ( receiver) ;
741
741
742
- if recv_ty. is_floating_point ( ) {
742
+ if recv_ty. is_floating_point ( ) && ! is_no_std_crate ( cx ) {
743
743
match path. ident . name . as_str ( ) {
744
744
"ln" => check_ln1p ( cx, expr, receiver) ,
745
745
"log" => check_log_base ( cx, expr, receiver, args) ,
@@ -750,10 +750,12 @@ impl<'tcx> LateLintPass<'tcx> for FloatingPointArithmetic {
750
750
}
751
751
}
752
752
} else {
753
- check_expm1 ( cx, expr) ;
754
- check_mul_add ( cx, expr) ;
755
- check_custom_abs ( cx, expr) ;
756
- check_log_division ( cx, expr) ;
753
+ if !is_no_std_crate ( cx) {
754
+ check_expm1 ( cx, expr) ;
755
+ check_mul_add ( cx, expr) ;
756
+ check_custom_abs ( cx, expr) ;
757
+ check_log_division ( cx, expr) ;
758
+ }
757
759
check_radians ( cx, expr) ;
758
760
}
759
761
}
0 commit comments