diff options
| author | Michael Wright <mikerite@lavabit.com> | 2019-01-31 06:20:49 +0200 |
|---|---|---|
| committer | Michael Wright <mikerite@lavabit.com> | 2019-01-31 06:32:29 +0200 |
| commit | 3cf8c0b3b52f14bda9001855369b72eca9737c1d (patch) | |
| tree | 8e0badc172345aade28fa4784e9e4b33328271f3 /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff | |
| parent | 6ce78d1257ac6fd77f245730fcfbadd536a173eb (diff) | |
| download | rust-3cf8c0b3b52f14bda9001855369b72eca9737c1d.tar.gz rust-3cf8c0b3b52f14bda9001855369b72eca9737c1d.zip | |
Fix `cast_sign_loss` false positive
This checks if the value is a non-negative constant before linting about losing the sign. Because the `constant` function doesn't handle const functions, we check if the value is from a call to a `max_value` function directly. A utility method called `get_def_path` was added to make checking for the function paths easier. Fixes #2728
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions
