File tree 7 files changed +28
-16
lines changed
7 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,8 @@ where
137
137
a_significand <<= shift;
138
138
a_exponent -= shift;
139
139
}
140
- } else
141
- /* addition */
142
- {
140
+ } else {
141
+ // addition
143
142
a_significand += b_significand;
144
143
145
144
// If the addition carried up, we need to right-shift the result and
Original file line number Diff line number Diff line change @@ -63,25 +63,22 @@ fn cmp<F: Float>(a: F, b: F) -> Result {
63
63
// a and b as signed integers as we would with a fp_ting-point compare.
64
64
if a_srep & b_srep >= szero {
65
65
if a_srep < b_srep {
66
- return Result :: Less ;
66
+ Result :: Less
67
67
} else if a_srep == b_srep {
68
- return Result :: Equal ;
68
+ Result :: Equal
69
69
} else {
70
- return Result :: Greater ;
70
+ Result :: Greater
71
71
}
72
- }
73
72
// Otherwise, both are negative, so we need to flip the sense of the
74
73
// comparison to get the correct result. (This assumes a twos- or ones-
75
74
// complement integer representation; if integers are represented in a
76
75
// sign-magnitude representation, then this flip is incorrect).
77
- else {
78
- if a_srep > b_srep {
79
- return Result :: Less ;
80
- } else if a_srep == b_srep {
81
- return Result :: Equal ;
82
- } else {
83
- return Result :: Greater ;
84
- }
76
+ } else if a_srep > b_srep {
77
+ Result :: Less
78
+ } else if a_srep == b_srep {
79
+ Result :: Equal
80
+ } else {
81
+ Result :: Greater
85
82
}
86
83
}
87
84
Original file line number Diff line number Diff line change
1
+ // The functions are complex with many branches, and explicit
2
+ // `return`s makes it clear where function exit points are
3
+ #![ allow( clippy:: needless_return) ]
4
+
1
5
use float:: Float ;
2
6
use int:: { CastInto , DInt , HInt , Int } ;
3
7
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ where
181
181
product_high += product_high & one;
182
182
}
183
183
184
- return F :: from_repr ( product_high) ;
184
+ F :: from_repr ( product_high)
185
185
}
186
186
187
187
intrinsics ! {
Original file line number Diff line number Diff line change 1
1
// TODO: when `unsafe_block_in_unsafe_fn` is stabilized, remove this
2
2
#![ allow( unused_unsafe) ]
3
+ // The functions are complex with many branches, and explicit
4
+ // `return`s makes it clear where function exit points are
5
+ #![ allow( clippy:: needless_return) ]
6
+ #![ allow( clippy:: comparison_chain) ]
7
+ // Clippy is confused by the complex configuration
8
+ #![ allow( clippy:: if_same_then_else) ]
9
+ #![ allow( clippy:: needless_bool) ]
3
10
4
11
//! This `specialized_div_rem` module is originally from version 1.0.0 of the
5
12
//! `specialized-div-rem` crate. Note that `for` loops with ranges are not used in this
Original file line number Diff line number Diff line change 17
17
// compiler on ABIs and such, so we should be "good enough" for now and changes
18
18
// to the `u128` ABI will be reflected here.
19
19
#![ allow( improper_ctypes, improper_ctypes_definitions) ]
20
+ // `mem::swap` cannot be used because it may generate references to memcpy in unoptimized code.
21
+ #![ allow( clippy:: manual_swap) ]
20
22
21
23
// We disable #[no_mangle] for tests so that we can verify the test results
22
24
// against the native compiler-rt implementations of the builtins.
Original file line number Diff line number Diff line change
1
+ // Trying to satisfy clippy here is hopeless
2
+ #![ allow( clippy:: style) ]
3
+
1
4
#[ allow( warnings) ]
2
5
#[ cfg( target_pointer_width = "16" ) ]
3
6
type c_int = i16 ;
You can’t perform that action at this time.
0 commit comments