Commit 834c413
committed
Fix cast_sign_loss false positive for float to uint casts
The cast_sign_loss lint was incorrectly triggering on float to unsigned integer casts, which cannot actually lose sign information since floats don't have the same sign semantics as signed integers. This change modifies the should_lint function to exclude float to uint casts from the cast_sign_loss lint. changelog: Fix [] false positive for float to unsigned integer casts fixed tests1 parent fab7eab commit 834c413
File tree
3 files changed
+86
-115
lines changed- clippy_lints/src/casts
- tests/ui
3 files changed
+86
-115
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 79 | + | |
| 80 | + | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | | - | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
71 | | - | |
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
| |||
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
85 | | - | |
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
| |||
0 commit comments