Commit Graph

2 Commits

Author SHA1 Message Date
Marijn Suijten
d4bf59b6ef size_of_in_element_count: Disable lint on division by byte-size
It is fairly common to divide some length in bytes by the byte-size of a
single element before creating a `from_raw_parts` slice or similar
operation. This lint would erroneously disallow such expressions.

Just in case, instead of simply disabling this lint in the RHS of a
division, keep track of the inversion and enable it again on recursive
division.
2021-01-19 20:05:40 +01:00
Marijn Suijten
391bb218b5 size_of_in_element_count: Separate test file in expressions and functions
An upcoming test case for new expresssion variants make the stderr file
go over 200 lines. Split this test case in two to have a clear
distinction between checking whether the lint is still applying on
all the functions with member counts as argument, versus validating
various member-count expressions that may or may not be invalid.
2021-01-19 20:05:39 +01:00