@@ -732,14 +732,14 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
732732impl < ' tcx > LateLintPass < ' tcx > for FloatingPointArithmetic {
733733 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
734734 // 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 ) {
736736 return ;
737737 }
738738
739739 if let ExprKind :: MethodCall ( path, receiver, args, _) = & expr. kind {
740740 let recv_ty = cx. typeck_results ( ) . expr_ty ( receiver) ;
741741
742- if recv_ty. is_floating_point ( ) {
742+ if recv_ty. is_floating_point ( ) && ! is_no_std_crate ( cx ) {
743743 match path. ident . name . as_str ( ) {
744744 "ln" => check_ln1p ( cx, expr, receiver) ,
745745 "log" => check_log_base ( cx, expr, receiver, args) ,
@@ -750,10 +750,12 @@ impl<'tcx> LateLintPass<'tcx> for FloatingPointArithmetic {
750750 }
751751 }
752752 } 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+ }
757759 check_radians ( cx, expr) ;
758760 }
759761 }
0 commit comments