Prefer a two value enum over bool

This commit is contained in:
Oli Scherer 2025-02-12 10:37:49 +00:00
parent 30f168ef81
commit 4f2b108816
9 changed files with 19 additions and 23 deletions

View file

@ -218,8 +218,9 @@ fn layout_of_uncached<'tcx>(
let mut end = extract_const_value(cx, ty, end)?
.try_to_bits(tcx, cx.typing_env)
.ok_or_else(|| error(cx, LayoutError::Unknown(ty)))?;
if !include_end {
end = end.wrapping_sub(1);
match include_end {
rustc_hir::RangeEnd::Included => {}
rustc_hir::RangeEnd::Excluded => end = end.wrapping_sub(1),
}
scalar.valid_range_mut().end = end;
}