@@ -453,9 +453,6 @@ fn is_float_mul_expr<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<(&'
453
453
454
454
// TODO: Fix rust-lang/rust-clippy#4735
455
455
fn check_mul_add ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) {
456
- if is_no_std_crate ( cx) {
457
- return ; // The suggested methods are not available in core
458
- }
459
456
if let ExprKind :: Binary (
460
457
Spanned {
461
458
node : op @ ( BinOpKind :: Add | BinOpKind :: Sub ) ,
@@ -570,9 +567,6 @@ fn are_negated<'a>(cx: &LateContext<'_>, expr1: &'a Expr<'a>, expr2: &'a Expr<'a
570
567
}
571
568
572
569
fn check_custom_abs ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) {
573
- if is_no_std_crate ( cx) {
574
- return ; // The suggested methods are not available in core
575
- }
576
570
if_chain ! {
577
571
if let Some ( higher:: If { cond, then, r#else: Some ( r#else) } ) = higher:: If :: hir( expr) ;
578
572
let if_body_expr = peel_blocks( then) ;
@@ -737,8 +731,8 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
737
731
738
732
impl < ' tcx > LateLintPass < ' tcx > for FloatingPointArithmetic {
739
733
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
740
- // All of these operations are currently not const.
741
- if in_constant ( cx, expr. hir_id ) {
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 ) {
742
736
return ;
743
737
}
744
738
0 commit comments